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:
00811544
Views:
14
Hi Stephen,

The MMF has many hooks that you can use. If you want to assign the primary key when adding a new row, then you can use the HookSetDefaultValues or the HookPostAddNewRow hooks. They are called one after another. To assign the primary key just before saving the row, you can use the HookPreSave method. MMF doesn't use these hook methods so you never have to worry about overriding or changing any behavior.

>If I want to manually assign the primary key of a table instead of using identity field, is there a recommend way to handle that in MM.NET? I basically want to add one to the highest primary key in the table.
>
>I currently have a store procedure that handle the insert and the assignment of the primary key, however, I don't know at what point should I override the MM.NET framework to call my SP.
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform