473,396 Members | 1,866 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

what type of variable for a UniqueIdentifier field?

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???



Feb 17 '08 #1
2 1582
i found it:

Dim rid As System.Guid
dtreader.GetGuid(0)
Feb 17 '08 #2
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

"Bart" <b@b.dwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
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???


Feb 17 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Bernie | last post by:
Greetings, I have 3 servers all running SQL Server 2000 - 8.00.818. Lets call them parent, child1, and child 2. On parent, I create a view called item as follows: CREATE view Item as...
4
by: Jacques Wentworth | last post by:
Hi I have the following problem. I have a SQL Server (2000) Stored Proc that with 4 parameter (one being @UnlockKey uniqueidentifier OUTPUT). I run it from Query Analyzer and the @Key parameter...
3
by: SMG | last post by:
Hi all, I created one table with following structure, and bound the same with a DataGird. But I am not able to see any column which is having 'uniqueidentifier' as datatype. Name ...
6
by: Sandy | last post by:
I'm building a SQL String and I want to choose only the records that are part of the current contractID. My Variable Dim contrID = Request.Params("oId" I put it into the SQL String WHERE ...
1
by: dawg1998 | last post by:
I am attempting to create a record that has a uniqueidentifier datatype. I am receiving the following error each time I attempt the Insert: Incorrect syntax near '-' The following is the code...
669
by: Xah Lee | last post by:
in March, i posted a essay “What is Expressiveness in a Computer Language”, archived at: http://xahlee.org/perl-python/what_is_expresiveness.html I was informed then that there is a academic...
3
by: iKiLL | last post by:
Hi all The Code is below but i will give you a brief over view first. I am using C#, SQL Mobile and the CF2.0 with Merge Replication. My Primary Keys are all "uniqueidentifier" types...
3
by: qhjghz | last post by:
Hi all, need some help. I have a table called my_table say, and there is a uniqueidentifier field in that table say my_column. When I execute this query, I get back a row select * from my_table...
7
NeoPa
by: NeoPa | last post by:
SQL Server 2000. It's all in the title really. I have checked in quickbooks and done a quick search but time is critical just now. I will continue to explore other avenues, but if anyone knows...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.