Solved

Numeric 4 Digit ID

Posted on 2006-11-06
3
268 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

724 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