Solved

Numeric 4 Digit ID

Posted on 2006-11-06
3
249 Views
Last Modified: 2010-04-24
Is there some kind of .net object that manages and returns 4 digit unique IDs?

For example I may have 1000 to 2000 users connected to my server and each of them needs a unique 4 digit ID.  

User 1 = 1000
User 2 = 1001
User 3 = 1002
...etc

Is there a .net object that I can just call upon that returns me these incremented numbers for example or something?
0
Comment
Question by:Hepen
  • 2
3 Comments
 
LVL 30

Accepted Solution

by:
irwinpks earned 500 total points
ID: 17885729
If you are using SQL, then you can create a field called ID, seed it with 1000, then increment automatically by 1 each time a new record is created.. this will be an "identity" field.

Somewhere you need to create a flat file database, or integrate a working db model.
0
 
LVL 13

Expert Comment

by:newyuppie
ID: 17885733
not that i know of. you may need to create your own class for doing this. or you could use the System.Guid.NewGuid to create unique GUID numbers, but they are more than 4 digits (i think they are 32 digits and letters, but they are unique 99.99% of the time).
0
 
LVL 30

Expert Comment

by:irwinpks
ID: 17885738
wow...that was quick...cool. thank you!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
I designed this idea while studying technology in the classroom.  This is a semester long project.  Students are asked to take photographs on a specific topic which they find meaningful, it can be a place or situation such as travel or homelessness.…
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now