Solved

Numeric 4 Digit ID

Posted on 2006-11-06
3
264 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Create a datatable in vb.net dynamically 1 39
How to duplicate form in Visual Studio 2015 2 98
VB.Net. Reading xml value 6 38
Need help with another query 10 38
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…
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

733 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