I’m trying to bind a checkbox to a details view as boolean 1,0. The database column is set to bit and not nulls. Below is my code,
<EditItemTemplate>
<asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Convert.ToBoolean(Eval("level"))%>' />
</EditItemTemplate>
<ItemTemplate>
<asp:CheckBox Enabled="false" ID="CheckBox1" runat="server" Checked='<%# Convert.ToBoolean(Eval("level"))%>' />
</ItemTemplate>
<InsertItemTemplate>
<asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Convert.ToBoolean(Eval("level"))%>' />
</InsertItemTemplate>
When you use edit or insert template you have to use
Bind.Evalis only one way so your object is trying to insert a null value.