Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Handling Identities
Message
From
16/03/2010 09:34:43
 
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01454212
Message ID:
01454763
Views:
30
>Frank,
>
>I realized after sending my last reply that your field was never mentioned as the PK. I use identity columns exclusively for PK's so I made that assumption. My bad!
>
>Anyway, the framework (or BLG) does nothing special with identity columns other than exclude them from the stored procedures for inserting and updating rows for the data layer since the database will take care of creating its value.
>
>As far as the AutoIncrement stuff is concerned, I have not used that so I can't any insight into how it's used. But you could still use the identity column for this but I would use this only if there is no need to change this value. If you still feel you need to change this (and I will add again that I don't know why you would want to do this) then you could create your own number generating process similar to what MM for VFP did. MM for VFP had a 'NewID' procedure that stored the last value used for a given table in an 'ID' table and then used that value for the new record after incrementing it.
>

Just to explain the numbering options I tend to offer in my system:

If I have a list of customers, say:

John Smith
Jane Doe
John Smith
Freddy Mercury

In order to allow a way of identifying the customer (especially in the event of duplicate names) I will also store a customer number like this:

001 John Smith
002 Jane Doe
003 John Smith
004 Freddy Mercury

Now, I know some clients actually prefer to use some other numbering scheme, so I leave the field for the customer number available on the form and only generate the next consecutive number if the user has not put any values in there. This way they can use their own numbering scheme, or they can use mine.

With respect to the NewID that is what I am looking for, but I don't think you can lock the record in my NewId table in SQL Server as you would do in VFP, so how could that be accomplished?
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Previous
Reply
Map
View

Click here to load this message in the networking platform