且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在数据库中保存Chechbox值

更新时间:2022-05-13 21:49:40

首先你必须创建一个数据库表,并将列名命名为Staus ..

然后在代码后面写这个,



if(Checkbox(status).Checked == true)

User.Status = 1;

else

User.Status = 0;



此处用户是类的对象,用于设置Property以将值插入数据库
First u have to create a DB table and named the column name as Staus..
then write this on code behind,

if (Checkbox(status).Checked == true)
User.Status = 1;
else
User.Status = 0;

here User is the the object of the class for setting the Property to insert the value in to database


int status = 0;

if(Checkbox.Checked == true)

状态= 1;

其他

状态= 0;



u可以将此值存储到数据库中
int status =0;
if (Checkbox.Checked == true)
Status = 1;
else
Status = 0;

u can store this value into database