如何使用组合框或复选框将数据添加到数据库中 [英] How do I add data into database using combobox or checkbox

查看:89
本文介绍了如何使用组合框或复选框将数据添加到数据库中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我有男性和女性作为复选框的文本属性,1,2,3 4作为组合框的项目。如何将此数据保存到访问数据库中。复选框和组合是vb.net,我应该在访问中给出复选框和组合框字段的数据类型是什么类型?



我尝试了什么:



我试图首先将组合框选择值链接到文本框,然后将文本框保存到数据库,但数据库上的文本框数据显示为空白:



textbox1.text = combobox.text



我怎么能单独使用组合框或复选框来实现而不是通过文本框

If i have male and female as text properties for a checkbox and 1, 2,3 4 as items for a combobox. How can I save this data into access database. checkbox and combo are vb.net and what type of data types should I give checkbox and combobox fields in access?

What I have tried:

I tried to first link combobox selecyed values to textbox then save textbox to database but then the text box data on database appears blank:

textbox1.text=combobox.text

how can I implement using combobox or checkbox alone not via textbox

推荐答案

首先需要捕获所有变量,并将它们用作数据库插入语句的参数。
You first need to capture all the variables, and use those as parameters to your database insert statements.


这篇关于如何使用组合框或复选框将数据添加到数据库中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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