473,503 Members | 5,004 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

GUID, New - How Created

When I use GUID.NewGUID method to return a unique GUID, how is it
constructed and can I be sure it won't be duplicated. I set a key in a
database equal to a GUID which I create using GUID.NewGUID and don't want it
to be duplicated. I would like to know what paramters are used by VB.Net to
construct the new GUID, i.e., tick count, processor ID, etc.
--
Dennis in Houston
Nov 21 '05 #1
5 1404
Dennis wrote:
When I use GUID.NewGUID method to return a unique GUID, how is it
constructed and can I be sure it won't be duplicated.


You may find the information here useful:

http://kruithof.xs4all.nl/guid-uuid-make.html

(I certainly learned something about GUIDs today :-)

--

(O) e n o n e
Nov 21 '05 #2
Thanks. It would a appear that GUID's are in fact unique with the only way
of getting a duplicate GUID would be for someone to reset the clock on the
computer or use the same ethernet card on two different computers and
generate a GUID at the same exact time.
--
Dennis in Houston
"Oenone" wrote:
Dennis wrote:
When I use GUID.NewGUID method to return a unique GUID, how is it
constructed and can I be sure it won't be duplicated.


You may find the information here useful:

http://kruithof.xs4all.nl/guid-uuid-make.html

(I certainly learned something about GUIDs today :-)

--

(O) e n o n e

Nov 21 '05 #3
Dennis,

I think that .Net GUIDs are generated using random numbers, not the clock or
MAC address, etc.

Kerry Moorman
"Dennis" wrote:
Thanks. It would a appear that GUID's are in fact unique with the only way
of getting a duplicate GUID would be for someone to reset the clock on the
computer or use the same ethernet card on two different computers and
generate a GUID at the same exact time.
--
Dennis in Houston
"Oenone" wrote:
Dennis wrote:
When I use GUID.NewGUID method to return a unique GUID, how is it
constructed and can I be sure it won't be duplicated.


You may find the information here useful:

http://kruithof.xs4all.nl/guid-uuid-make.html

(I certainly learned something about GUIDs today :-)

--

(O) e n o n e

Nov 21 '05 #4
Dennis wrote:
Thanks. It would a appear that GUID's are in fact unique with the
only way of getting a duplicate GUID would be for someone to reset
the clock on the computer or use the same ethernet card on two
different computers and generate a GUID at the same exact time.


It depends on which type of GUID is generated.

All the GUIDs that VS.NET generates appear to be version 4, which is
entirely based on random numbers. This means that there is no guarantee of
uniqueness, just a high probability.

--

(O)enone
Nov 21 '05 #5
FYI:

This talks about GUIDs for UniqueIdentifier columns in SQLServer - what they
are, the ups and downs of using them and how to get around the major
performance hit of the path you seem to have chosen with your column type.

Not hard reading, it's a classic for DB folks and I think it might help you:

http://www.informit.com/articles/art...&seqNum=1&rl=1

smith
www.smithvoice.com

"Dennis" <De****@discussions.microsoft.com> wrote in message
news:AB**********************************@microsof t.com...
When I use GUID.NewGUID method to return a unique GUID, how is it
constructed and can I be sure it won't be duplicated. I set a key in a
database equal to a GUID which I create using GUID.NewGUID and don't want
it
to be duplicated. I would like to know what paramters are used by VB.Net
to
construct the new GUID, i.e., tick count, processor ID, etc.
--
Dennis in Houston

Nov 21 '05 #6

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

Similar topics

1
7706
by: Jim Shank | last post by:
I am adding support to my application for Oracle 10g and using Enterprise Library Data Access Application Blocks and trying to determine the best way to convert the GUID's which are stored as...
6
2269
by: Bernd Koehler | last post by:
Hi: I am a EE prof currently teaching an IT course. One the assignments students recently completed was designing a small MS Access Database. I have two submissions that are remarkably...
3
14613
by: some one | last post by:
I'm writing a program in C (microsoft vc++) to read in a binary file (which was created by a C++ program) where a few fields are C++ GUIDs. I'm not sure how to define my variable to read in this...
6
1425
by: Doug | last post by:
I have a value that was a GUID converted to string and stored in the DB. I need to get that value back into a Guid, how can i do that? Do something like (System.Guid)<GUIDStringVariable> does not...
0
1372
by: Alexander Muylaert | last post by:
Hi Does anybody has an idea how to have guids, created on many computers, sorted by Timestamp? It doesn't have to be very accurate, but it would mean a great optimization for my datastructures....
4
1650
by: Brett | last post by:
The following is called each time an event is triggered. The generated GUID is the same for 3 of 4 calls. Is there a way to ensure it is different for each call? ...
26
11507
by: John Grandy | last post by:
Is it possible to generate a 20 byte integer from a GUID that is "unique enough" ( just like a GUID is not truly unique , but is "unique enough" ). We identify transactions with GUIDs , but a...
4
1568
by: Dean Slindee | last post by:
I would like to use a Guid as a record identifier for to prevent update collisions (not as the key, but as a substitute for a timestamp field). What is the proper way to define storage for a guid...
10
4352
by: Charles Hunt | last post by:
Hi, When running this code in VB2003 Sub guidtest() Dim gstring As String Dim gid As Guid
5
6473
by: Michael Primeaux | last post by:
I have a simple .NET 2.0 web service created with VS.NET 2005 with a single web method with the following signature: void HelloWorld(Guid parameter1); When calling this method I receive the...
0
7188
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
7313
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6970
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
5558
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 project—planning, coding, testing,...
1
4987
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4663
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3156
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3146
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
366
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.