如何将gridview复选框选中的值更新为1到asp.net中的数据库 [英] how to update gridview checkbox selected value as 1 to database in asp.net

查看:113
本文介绍了如何将gridview复选框选中的值更新为1到asp.net中的数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的,



如何将gridview复选框选中的值更新为1到asp.net中的数据库

===== ================================================== ======



我在数据库表中有3列,用户名,密码,状态



在我的网页上我有gridview与复选框。只有用户可以选择一个复选框。



以下这个gridview我有提交按钮,将数据库中的选中值存储为1.



请帮助我。



选中复选框后,用户将点击提交按钮。然后该值将在数据库中保存为1.



帮助表示赞赏。





谢谢。

Dear all,

how to update gridview checkbox selected value as 1 to database in asp.net
=============================================================

I have 3 columns in database table, Username,password,Status

on my webpage i have gridview with checkboxes in it. Only user can select one checkbox.

and below this gridview i have submit button to store checked value in database as 1.

Please can you help me.

after selecting checkbox, user will click on submit button. then the value will save in database as 1.

help is appreciated.


Thanks.

推荐答案

如果表中状态列的数据类型是BIT类型,则必须从应用程序中选择0或1表示你在表中传递true或false作为字符串,然后抛出一个错误。
if the data type of status column in your table is of BIT type then you have to paas 0 or 1 from your application means if you pass true or false as a string in your table then this thrown an error.


这篇关于如何将gridview复选框选中的值更新为1到asp.net中的数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆