0

I have a form in my application which has several text boxes and I agree checkbox. In database I have to insert the data when a users fill the form. I know how to insert data from text box and other fields but I do not know how to do it for a checkbox. How to define it in table and how to define it in insert statement?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Valley
  • 71
  • 1
  • 2
  • 10

2 Answers2

2

In the table, supposing you're using SQL Server, you'll use the bit type. In the application, use parameters in the commands, so you can just pass a boolean value to the corresponding parameter.

Geeky Guy
  • 9,229
  • 4
  • 42
  • 62
2

You can use Bit field for 1/0 values in sql server.

also : How do you create a yes/no boolean field in SQL server?

Community
  • 1
  • 1
adt
  • 4,320
  • 5
  • 35
  • 54