On 31 Jan 2007 02:33:19 -0800, "ba.hons" <ba*****@gmail.comwrote:
>Hello all,
Was wondering if anyone could provide some info on what could be a
possible solution to a problem am having.
I have to generate a Unique Identifier in C# which I will use to
assign to a user, i dont really need the Unique Identifier's to be
sequential so i was considering using system.time.hour +
system.time.minute. + system.time.second, but am worried about
daylight savings and also people altering the time on the host PC.
I dont really want to use a database with just one table and one
field, and i would prefer to not use a file which just saves the value
and increments by one each time i want a new Unique Identifier.
Does anyone know of a way i could get a Unique Identifier??
thanks,
Adam
After reading all the other suggestions given you and your responses it seems
you've rejected all the common methods of assigning unique identifiers.
Your idea that you can use the hour minute and second to do that is flawed
because in the database world generation of data can occur simultaneously. Using
the time generated method would indeed assure that you would end up with
duplicate identifiers because of the lack of resolution.
I once worked for a small company whose HR department dictated that employees be
issued employee IDs that were the last four digits of their social security
number. When I told them it wouldn't work they laughed. Two months later after
hiring an new employee we hit the first duplicate. They didn't think it was
funny after that.
Take the advice given you. You'll be glad you did.
Good luck with your project,
Otis Mukinfus
http://www.arltex.com http://www.tomchilders.com