Solved

Numeric 4 Digit ID

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

757 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

19 Experts available now in Live!

Get 1:1 Help Now