如何在数据库中读取/检查复选框的值? [英] How to read/check like checkbox's value in database?

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

问题描述


我使用循环来提取数据并在表单上显示,这里的一切正常,除了我的数据库设置中的一列像复选框一样我无法读/以编程方式检查它的值。


我的数据库有一列,它的设置类似于一个复选框,其数据类型为Yes / No,格式为True / false。


我试过了:  Checkbox1.checkstate = row.cells(" Val")。Value。 没有运气。


如何使用代码阅读/检查其值?


如果其值为False,则以编程方式将其设置为True,如果为True,则以编程方式将其设置为False。


数据库:MS访问



谢谢。



解决方案

嗨LA_Bob,


请执行以下操作添加CheckBox Datagridview中的列。





希望这会对你有所帮助。



谢谢,


Sabah Shariq


I use for loop to pull data and display on the form and everything works fine here, except one column in my database setup like a checkbox and I cannot read/check the value of it programmatically.

My database has one column and it is setup like a checkbox and its data type is Yes/No and format is True/false.

I tried:  Checkbox1.checkstate = row.cells("Val").Value.  No luck.

How do I read/check its value using code?

If its value is False, then set it to True programmatically and if it is True, then set it to False programmatically.

Database: MS access

Thanks.

解决方案

Hi LA_Bob,

Please do the following to add CheckBox column in Datagridview.

Hope this helps you.

Thanks,

Sabah Shariq


这篇关于如何在数据库中读取/检查复选框的值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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