Creating a UNIQUE value

  • Thread starter Thread starter David Pope
  • Start date Start date
D

David Pope

I need to create a UNIQUE number similar to a GUID but all numbers. Does
anyone know of an algorithm or anything?

TIA,

Dave
 
Hi David,

In case you are looking at how to create GUID, then the framework has a
class called System.Guid, which does this...

Very simple... Have a look at these links....for code snippets
http://www.csharphelp.com/archives/archive188.htm
http://msdn.microsoft.com/library/d...n-us/cpref/html/frlrfSystemGuidClassTopic.asp

In case you want to write / use algorithm for generating the number, then
check this link for code snippet in C#...
http://www.c-sharpcorner.com/1/unique.asp

HTH,

Need any help, do post a msg back..


Happy Coding
 
Hi David

How about System.DateTime.Now.Ticks

it gives you a unique number as long as the number is not created too
rapidily.....

just an idea....
 
Back
Top