ASP.NET - How to edit 'bit' data type?
- by Peter
I am coding in Visual Basic. I am using a checkbox control. Now depending on its checked property I need to set/unset a bit column in a SQL Server database. Here's the code:
Try
conSQL.Open()
Dim cmd As New SqlCommand("update Student set send_mail = " + _
sendemailCheckBox.Checked.ToString + " where student_id = '" _
+ sidnolabel.Text + "'", conSQL)
cmd.ExecuteNonQuery()
Finally
conSQL.Close()
End Try
The send_mail attribute is of bit datatype. This code is not working.
How do I go about it?