如何从checkedlistbox获取已检查项的值并将其插入到c#中的数据库中 [英] how to get value of checked item from checkedlistbox and insert them to database in c#

查看:53
本文介绍了如何从checkedlistbox获取已检查项的值并将其插入到c#中的数据库中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从

checkedlistbox获取已检查项目的值并插入数据库

解决方案

您可以使用 CheckedListBox.CheckedItems Property [ ^ ]和根据您的数据绑定获取已检查项目的值 [ ^ ]

当你有需要插入数据库的数据时,可以执行带有参数设置的sql insert命令,如下所示

使用C#插入SQL查询 [ ^ ]

how to get value of checked item from
checkedlistbox and insert into database

解决方案

you can use CheckedListBox.CheckedItems Property[^] and get the values of checked items based on your data bindings[^]
when you have the data which need to insert into database, you can execute sql insert command with set of parameters as below
SQL Insert Query Using C#[^]


这篇关于如何从checkedlistbox获取已检查项的值并将其插入到c#中的数据库中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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