Posts Topics Forums Images
Search videos from message boards Videos Search messages from microblogs Microblogs Search messages from imdb.com Imdb Search messages from yuku.com Yuku Search messages from lefora.com (free forums) Lefora
My account: Login | Sign Up
Loading... 

Thread: GUID Unique identifer theory question

Started 1 month, 2 weeks ago by saludalabs
I have a question about GUID. I created a calender admin program that stores event data in an xml file. The xml file consist of an element called call ID. I am using ID as a key. Each event has a unique id. My code generates a GUID for each new event. Currently I set up a method in my code behind to see if the GUID exist before I except the value of the new GUID. My understanding the ...
Site: CodeProject: Discussion Boards. Free source code and programming help  CodeProject: Discussion Boards. Free source code and programming help - site profile
Forum: C#  C# - forum profile
Total authors: 3 authors
Total thread posts: 4 posts
Thread activity: no new posts during last week
Domain info for: codeproject.com

Other posts in this thread:

PIEBALDconsult replied 1 month, 2 weeks ago
Better safe than sorry. I generally use a database, so the GUIDs I generate as primary keys gets checked by the database engine. But, yes, they do get checked and an Exception will be thrown if a duplicate is ever detected. If you are creating your own database, you should perform the check.

Richard MacCutchan replied 1 month, 2 weeks ago
According to MSDN (Remarks) [ ^ ], GUIDs are as globally unique as possible. The probability of seeing two the same in the world (universe?) is very low. The probability of seeing two the same on a single PC is infinitesimal. Your process looks fine, if you hit a duplicate then just generate a new one and continue. Alternatively you may like to consider a simpler key, such as time and date, ...

saludalabs replied 1 month, 2 weeks ago
I ended up rewriting an old calendar app because of the duplicate key problem. I will leave the duplicate check code in thier just in case, it seems like the fastest solution. The amount of data depends on the client, I have some clients who enter large amounts of event, in those cases I push them to using sql server.

 

Top contributing authors

Name
Posts
saludalabs
2
user's latest post:
GUID Unique identifer theory...
Published (2009-11-09 09:51:00)
I ended up rewriting an old calendar app because of the duplicate key problem. I will leave the duplicate check code in thier just in case, it seems like the fastest solution. The amount of data depends on the client, I have some clients who enter large amounts of event, in those cases I push them to using sql server.
PIEBALDconsult
1
user's latest post:
GUID Unique identifer theory...
Published (2009-11-09 09:44:00)
Better safe than sorry. I generally use a database, so the GUIDs I generate as primary keys gets checked by the database engine. But, yes, they do get checked and an Exception will be thrown if a duplicate is ever detected. If you are creating your own database, you should perform the check.
Richard MacCutchan
1
user's latest post:
GUID Unique identifer theory...
Published (2009-11-09 09:46:00)
According to MSDN (Remarks) [ ^ ], GUIDs are as globally unique as possible. The probability of seeing two the same in the world (universe?) is very low. The probability of seeing two the same on a single PC is infinitesimal. Your process looks fine, if you hit a duplicate then just generate a new one and continue. Alternatively you may like to consider a simpler key, such as time and date, sequence number, combination of the two etc. It all...

Related threads on "CodeProject: Discussion Boards. Free source code and programming help":

Related threads on other sites:

Thread profile page for "GUID Unique identifer theory question" on http://www.codeproject.com. This report page is a snippet summary view from a single thread "GUID Unique identifer theory question", located on the Message Board at http://www.codeproject.com. This thread profile page shows the thread statistics for: Total Authors, Total Thread Posts, and Thread Activity