通过数据库中的复选框插入数据 [英] Insert data through checkbox in database?

查看:77
本文介绍了通过数据库中的复选框插入数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的页面中有一个复选框我要插入复选框值保存在数据库中??



我尝试了什么:



_dConfiguration.Bonded = Convert.ToBoolean(checkBonded.Value);

in my page there is one checkbox And I want to insert checkbox value save in database??

What I have tried:

_dConfiguration.Bonded = Convert.ToBoolean(checkBonded.Value);

推荐答案

使用已检查 [ ^ ]属性



它已经是一个布尔值,所以不需要施放。

use Checked [^]Property

it is already a boolean so no need of casting.
_dConfiguration.Bonded = checkBonded.Checked;


这篇关于通过数据库中的复选框插入数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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