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.comwww.prenia.comWeblog: blogs.prenia.com/cathi