简体   繁体   English

SQL Server Management Studio中的复选框

[英]Checkbox in SQL Server Management Studio

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? 如何在表中定义它以及如何在插入语句中定义它?

In the table, supposing you're using SQL Server, you'll use the bit type. 在表中,假设您使用的是SQL Server,将使用bit类型。 In the application, use parameters in the commands, so you can just pass a boolean value to the corresponding parameter. 在应用程序中,请在命令中使用参数,因此您只需将布尔值传递给相应的参数即可。

You can use Bit field for 1/0 values in sql server. 您可以在SQL Server中将字段用于1/0值。

also : How do you create a yes/no boolean field in SQL server? 还: 如何在SQL Server中创建一个是/否布尔值字段?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM