what is the proper to bind checkbox

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
 
N

Nicholas Paldino [.NET/C# MVP]

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.
 
G

GS

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top