Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Manual assignment of Primary Key
Message
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
00811534
Message ID:
00811544
Vues:
15
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform