使用复选框将记录保存在数据库中 [英] Save the record in the database using checkbox

查看:90
本文介绍了使用复选框将记录保存在数据库中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如下的Ms Access中的数据库结构如下;



日文本

会话1是/否(数据类型)

Session2是/否

Session3是/否

Session4是/否





在datagridview中设计如下;



日会议



星期一复选框1复选框2 checkbox3 checkbox4

to



星期六





在运行模式下,



例如星期一我选择checkbox1,

为星期二我选择checkbox3并保存在数据库中。





使用复选框我如何保存在数据库中。



for that我怎么能用c sharp







注意它是windows应用程序。< br $>




请帮帮我。

问候,

Narasiman P

Database structure as follows in Ms Access as follows;

Day Text
Session1 yes/No (data Type)
Session2 yes/No
Session3 yes/No
Session4 yes/No


Design as follows in datagridview ;

Day Session

Monday checkbox1 checkbox2 checkbox3 checkbox4
to

saturday


in the run mode,

for example monday i select the checkbox1,
for tuesday i select the checkbox3 and save in the database.


using check box how can i save in the database.

for that how can i do using c sharp



Note it is windows application.


Please help me.
Regards,
Narasiman P

推荐答案

我认为复选框不是一个好主意,如果想要保存一天的数据,radiobutton将做到最好,



两者,



为checkbox1_checkedchange(对象发送者,eventargs e)编写代码





如果checkbox1.checked == true

{

执行查询以保存数据

}
i think checkbox is not a good idea if want to save data for a day, radiobutton will do the best,

for both,

write code for checkbox1_checkedchange(object sender, eventargs e)


if checkbox1.checked==true
{
Execute query to save Data
}


这篇关于使用复选框将记录保存在数据库中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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