Unique number identifier generation

Posted by xwrs on Stack Overflow See other posts from Stack Overflow or by xwrs
Published on 2012-01-01T09:51:43Z Indexed on 2012/06/18 9:16 UTC
Read the original article Hit count: 163

Filed under:
|
|

I have to create logic for generation unique number identifier for records in database. id, generated in database is a separate column.

At this moment, when user calls "create record" action, I save new record, get its database id, generate record number using this id, then put it to the edit form. Using this way means that all entity fields should be nullable to save record to database.

I don't like this way. I know that should be better way.

Is there a better practice to generate unique number identifier? What is possibility of generating non-unique random numbers?

Thank you

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET