I am inserting a new row into a dataset dsStaff1 via DataAdapter1.Update() method. I am getting the following error:
Cannot insert the value NULL into column 'Enabled', table 'dbo.tblStaff'; column does not allow nulls. INSERT fails. The statement has been terminated.
I do have a boolean field 'Enabled' in tblStaff, which is keyword in SQL Server I suppose. It is defaulted to 'True'. I can't really change the name of the field. Is there a work around? OR am I doing something wrong? PS: I am generating insert, update commands by an sqlcommand builder.
If you have a default, then your SQL Command builder must be sending NULL (DBNull.Value) to override the default. The default will apply only if:
One of these 2 forms: