我们需要在单个组合框中捕获许多数据,然后在c#中单击按钮将它们插入数据库. [英] we need to capture many data in single combobox and insert them into database on button click in c#.

查看:77
本文介绍了我们需要在单个组合框中捕获许多数据,然后在c#中单击按钮将它们插入数据库.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们需要在单个组合框中捕获许多数据,然后在c#中单击按钮将它们插入数据库中.

we need to capture many data in single combobox and insert them into database on button click in c#.

推荐答案

您可以通过遍历ComboBox 项目.完成后,您可以运行更新查询以保存到数据库.

You can get the values by looping through the ComboBox Items. Once that is done you can run an update query to save to the database.

foreach( ComboBoxItem item in ComboBox1.Items )
{
  string strValue = Convert.ToString(item);
  /*Implement an update query to save to the database here*/
}


我刚刚回答了同样的问题.
这是我的相同答案...

我认为您是C#.Net的初学者,我建议您首先学习有关C#基本的知识.
尽管您可以看到此处是有关Windows窗体应用程序中的插入,更新,删除"的非常基本的文章,但可能会有所帮助您.
i have just answered to the same kind of question.
and here is my same answer...

i think you are very beginner in the C#.Net i suggest you to learn something about C# basic first.
though you can see here is very basic article for Insert,Update,Delete in Windows Form Application that may helps you.


这篇关于我们需要在单个组合框中捕获许多数据,然后在c#中单击按钮将它们插入数据库.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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