Checkbox into/out of MS SQL as what value?

  • Thread starter Thread starter hari
  • Start date Start date
H

hari

I am trying to enter the results of a checkbox into an MS SQL table.The
checkbox returns a bool value that I want to place in the database as a bit.
Or is there a better method? I need to read those bits back into the
checkboxes when the database is queried.

Thanks for any help on this.
Harry
 
Read the bit value from the database and cast it into a bool. Then set the
checkbox value property to that bool value
 
IMHO bit is the best way to store boolean value in SQL Server.

in most cases you should be alright.... if you face any problems just use
explicit cast and you should be fine.

--

Regards,

Hermit Dave (D'way)
http://hdave.blogspot.com
 
checkbox value property to that bool value

That would be the ckeckbox's "checked" attribute.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Neither a follower
nor a lender be.
 

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

Back
Top