Tris

Tris

  • NA
  • 1
  • 0

Check boxes 1 - 0 and true - false

Jun 25 2009 8:15 AM
Hi, thought it time i stopped lurking :) Im currently building a project in .net and im having issues with check boxes. On one form i have a few text boxes for username, password, initials. Then check boxes to tick (these will be to allow/deny access to various forms later) this info is then saved to SQL database using a query. The check box values saving as 1 or 0, it being ticked or not. Now on another form for existing users, i have identical check boxes, these ones however have to be bound, so i have a databing for "checkstate" set in the properties for each one. This works fine when i test the form. However, if i then hit the "save" button on this form, i get an error. The update tries to save the checkbox values as "true" or "false" and not 0 or 1. I cant for the life in me see how to set the checked value = 1, unchecked value = 0 properties. You can do that on check boxes in a gridview, but i cant see how on regular check boxes. Any ideas?

Answers (1)