Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to retrieve the new primary key?
Message
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
00809477
Message ID:
00810697
Vues:
24
The problem is with the CommandBuilder and not MMF. YOu will need to set the default values for each column that is not configured to accept nulls.

>I am not overriding any of the SQL command in the data layer, which mean MM.NET is using the commandbuilder. Do you mean I have to tell the data object which field is not allow null if I want to retrieve the primary key? Is this also mean the default value in SQL schema is not compatiable with MM.NET?
>
>Stephen
>
>
>
>>The default values are not used by ADO.NET to store the values before performing the update. That is handled by the SQL Server. When you set the flag in MMF to retrieve the primary key, it appends a select statement to the insert. Are you building you own insert statement or are you having MMF use the commandbuilder? If using the commandbuilder, you will want to set the default values of the fields or set AllowNulls to true.
-----------------------------------------

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