what is the proper to bind checkbox

  • Thread starter Thread starter GS
  • Start date Start date
G

GS

I tried to represent windows form checkbox as int 1 for checked otherwise 0
and bind as checkstate. That did not work. should I bind to text or
whatever, or I should use something other than Int in the sql database?

I tried Google so far no luck, built-in help no luck except possibly some
thing for web.ui
 
You should bind to the field to the Checked property. You should also
cast the return value from the database to a boolean, not an integer.
 
thank you very much. Glad to see it working.


Nicholas Paldino said:
You should bind to the field to the Checked property. You should also
cast the return value from the database to a boolean, not an integer.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

GS said:
I tried to represent windows form checkbox as int 1 for checked otherwise 0
and bind as checkstate. That did not work. should I bind to text or
whatever, or I should use something other than Int in the sql database?

I tried Google so far no luck, built-in help no luck except possibly some
thing for web.ui
 
Back
Top