what type of variable for a UniqueIdentifier field?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bart

    what type of variable for a UniqueIdentifier field?

    Hi,

    i made a select which fetches the value of a UniqueIdentifie r field
    (aspnet_Roles.R oleId )
    my questions are:
    1) variable 'myrole' must be defined as what?
    2) myrole=dtreader .Get??

    Thanks
    Bart

    dim myrole as ???
    comd.CommandTex t = "select aspnet_Roles.Ro leId from aspnet_roles"
    connection.Open ()
    dtreader = comd.ExecuteRea der
    dtreader.Read()
    myrole = dtreader.Get???







  • Bart

    #2
    Re: what type of variable for a UniqueIdentifie r field?

    i found it:

    Dim rid As System.Guid
    dtreader.GetGui d(0)


    Comment

    • Mark Fitzpatrick

      #3
      Re: what type of variable for a UniqueIdentifie r field?

      A uniqueidentifie r is a Globally Unique Identifier, which is a System.Guid
      data structure. I think you would use GetGuid() with the sql data reader.

      Hope this helps,
      Mark Fitzpatrick
      Microsoft MVP - Expression

      "Bart" <b@b.dwrote in message
      news:%234hoyWYc IHA.3940@TK2MSF TNGP05.phx.gbl. ..
      Hi,
      >
      i made a select which fetches the value of a UniqueIdentifie r field
      (aspnet_Roles.R oleId )
      my questions are:
      1) variable 'myrole' must be defined as what?
      2) myrole=dtreader .Get??
      >
      Thanks
      Bart
      >
      dim myrole as ???
      comd.CommandTex t = "select aspnet_Roles.Ro leId from aspnet_roles"
      connection.Open ()
      dtreader = comd.ExecuteRea der
      dtreader.Read()
      myrole = dtreader.Get???
      >
      >
      >
      >
      >
      >
      >

      Comment

      Working...