如何使用c#从数据库中获取datagridiview中的复选框值 [英] how to get the check box value in datagridiview from the database using c#

查看:64
本文介绍了如何使用c#从数据库中获取datagridiview中的复选框值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从数据库中获取datagridview中的复选框值。



在数据库记录中如下;

 CourseCode Days Sess1 Sess2 Sess3 Sess4 
REO 1 checkboxchecked checkboxchecked checkboxchecked checkboxchecked



设计如下;



课程代码组合框



Datagridview如下;

< pre lang =text> Days 1 2 3 4

1 checkboxchecked checkboxchecked checkboxchecked checkboxchecked





当我单击课程代码(REO)我想从数据库检查课程REO,在数据库中检查会话的天数。



我该怎么办?使用csharp。



我想从数据库中查看在组合框中选择的课程并显示在datagridview中。



问候,



narasiman P.

解决方案

你可以使用BIT数据类型,用于存储已检查/未检查的数据库中的值。



当您从SQL获取数据并将其绑定到网格视图时,它将自动显示复选框with checked / unchecked option。


I want to get the check box value in datagridview from the database.

In Database records as follows;

CourseCode  Days   Sess1             Sess2            Sess3          Sess4
  REO        1    checkboxchecked checkboxchecked checkboxchecked checkboxchecked


Design as follows;

Course code Combo box

Datagridview as follows;

Days          1                2                 3             4

 1      checkboxchecked checkboxchecked  checkboxchecked  checkboxchecked 



when i click the Course Code (REO) i want to check from the datbase for the course REO, how many days session are checked in the database.

for that how can I do using csharp.

I want to check from the database for the course selected in the combobox and display in to the datagridview.

Regards,

narasiman P.

解决方案

You can use BIT Data type to store checked/unchecked Value in Database.

And when you fetch the data from SQL and Bind it to Grid view, it will automatically display the check box with checked/unchecked option.


这篇关于如何使用c#从数据库中获取datagridiview中的复选框值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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