what type of variable for a UniqueIdentifier field?

  • Thread starter Thread starter Bart
  • Start date Start date
B

Bart

Hi,

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

Thanks
Bart

dim myrole as ???
comd.CommandText = "select aspnet_Roles.RoleId from aspnet_roles"
connection.Open()
dtreader = comd.ExecuteReader
dtreader.Read()
myrole = dtreader.Get???
 
A uniqueidentifier 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
 
Back
Top