W
Wayne Wengert
I am using VB in a VSNET 2003 Windows application. I've run into a situation
where, when trying to set a bit value in a SQL Server 2000 database I get
errors because the values extracted from a datarow return True or False. In
the snippet below, the SQL becomes "Update myTable SET EQ = True" which
fails with an error that "True" is not a valid column name? I gather that
the datarow object returns True or False for bit fields? I can always recode
this to get around the problem but I am trying to understand what the rules
are here?
========== Sample Code =============
Dim dr As DataRow
If chkEqp.Checked Then dr("EQ") = 1 Else dr("EQ") = 0
' If I need to manually do the update I use this code
"Update myTable SET EQ = " & dr("EQ")
where, when trying to set a bit value in a SQL Server 2000 database I get
errors because the values extracted from a datarow return True or False. In
the snippet below, the SQL becomes "Update myTable SET EQ = True" which
fails with an error that "True" is not a valid column name? I gather that
the datarow object returns True or False for bit fields? I can always recode
this to get around the problem but I am trying to understand what the rules
are here?
========== Sample Code =============
Dim dr As DataRow
If chkEqp.Checked Then dr("EQ") = 1 Else dr("EQ") = 0
' If I need to manually do the update I use this code
"Update myTable SET EQ = " & dr("EQ")