读书人

checkbox有关问题

发布时间: 2012-05-28 17:59:33 作者: rapoo

checkbox问题
在窗体界面上,我如果单击Checkbox则表示选中,数据库的字段类型中有bit,我怎么把这个值传给bit。让数据库更新为true。

[解决办法]
int i = Convert.ToInt32(checkbox1.Checked);
"update xxxx set bitfield="+i.ToString();
[解决办法]
bit对应的就是bool.

因此用
CheckBox.Checked Property

Gets or set a value indicating whether the CheckBox is in the checked state.
http://msdn.microsoft.com/en-us/library/system.windows.forms.checkbox.checked.aspx


读书人网 >C#

热点推荐