Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Manual assignment of Primary Key
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
00811534
Message ID:
00811706
Views:
14
You shouldn't lock a table or record across multiple SQL calls, that was the Foxpro way of assigning PK. My main question here is which method in the framework can I override so I can call a SP instead of using the CommandBuilder to perform the INSERT.

There is another way I can think of which is retrieve the max PK, then attempt the insert with a try catch block, retry the insert with the next number for a number of times. Again, where should I add this code?

Stephen


>How you get at the next primary key is a separate issue from MMF. Some developers us an ID table that contains the next id to use for each table. The table is locked while the next key is extracted to avoid any concurrency issues. If you find the next id from the actual table, you will need to manually deal with concurrency issues.
Stephen Lee

--------------------------------
Too much to code
Too little time
--------------------------------
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform