Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Generating Consecutive Numbers
Message
 
To
17/03/2010 14:12:13
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01455132
Message ID:
01455162
Views:
54
>>Hi,
>>
>>how do I generate consecutive numbers (for use as a customer number for example)? Is there anything in the framework that achieves this? I found reference to a function that autoincrements values, but it appears to b eonly on Primary Keys, this field is a candidate key.
>
>I used to have a foxpro method that did that. Oh wait, it was a Open Access method. That goes back a few years. It would be pretty easy to do it Frank if you wanted to I could dig up some old code. The one I did was used to create Permit numbers where I didn't want to skip any numbers like so many of them do if an order is canceled. I wrote my own that didn't skip. The complication on your situation is going to be since you also allow the user to enter what they want is you will have to generate your next valid number and also verify it doesn't already exist..
>
>I haven't heard back yet about if the framework has a way to hook into the autoincrement and at some point I will poke around to see if it is possible. I suspect it is a mechanism of the dataset stuff.
>
>Let me know if you want any of my old code that would help with making your own method.
>Tim

What database are you using?

SQL Server has the Identity type column - autoincrements w/o any client code.
____________________________________

Don't Tread on Me

Overthrow the federal government NOW!
____________________________________
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform