EDN Admin
Well-known member
I have a SQL database and a table with one of the columns being a "bit". If I set the column to AllowDBNull = true then all works fine. However if I change it to AllowDBNull = false then I get an exception <font size=2>
</font>"Cannot insert the value NULL into column bt, table COCUMENTS AND SETTINGSDB.MDF.dbo.tb; column does not allow nulls. INSERT fails." <font size=2>
workRow[</font><font color="#a31515" size=2>"bt"</font><font size=2>] = true</font><font size=2>;</font> <font size=2>
dsDataSet.tb.Rows.Add(workRow);
tbTableAdapter.Update(dsDataSet.tb); </font>
the row is set to true so surely it is not Null?
<font size=2></font>
View the full article
</font>"Cannot insert the value NULL into column bt, table COCUMENTS AND SETTINGSDB.MDF.dbo.tb; column does not allow nulls. INSERT fails." <font size=2>
workRow[</font><font color="#a31515" size=2>"bt"</font><font size=2>] = true</font><font size=2>;</font> <font size=2>
dsDataSet.tb.Rows.Add(workRow);
tbTableAdapter.Update(dsDataSet.tb); </font>
the row is set to true so surely it is not Null?
<font size=2></font>
View the full article