View Single Post

   
  #1 (permalink)  
Old 02-28-2008, 05:37 AM
Jesse
 
Posts: n/a
Default ASP.NET Access to MySQL BIT field????-Help

OK. I don't recall having a problem with this before, but, how do I assign
a variable to a MySQL Bit field? I'm trying to set up a CheckBox that is on
my form, and I've tried variations of the following:

FirstTime.Checked = CBool(RS("FirstTime"))
FirstTime.Checked = CBool(RS("FirstTime").ToString)
FirstTime.Checked = RS("FirstTime")
FirstTime.Checked = Convert.ToBoolean(RS("FirstTime"))

I believe that all of them give the error, "String was not recognized as a
valid Boolean". When I view the field value in SQL Manager 2005 Lite, It
presents a check box for the field value. When I view it through the MySQL
Query Browser, it presents the value as b'1'

Any hints? I'm sure this is a basic issue, but I just can't seem to find a
way to do it.

Thanks,
Jesse

Reply With Quote