如何将列表框中选定的项目保存到数据库中。 [英] how to save listbox selected items into data base.

查看:98
本文介绍了如何将列表框中选定的项目保存到数据库中。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个列表框如下;



列表框1和列表框2.



时我选择列表框1选择的项目列表框2.



编码工作正常没问题。



但我希望List box2选中的项目保存在数据库中。



我该怎么办。



请帮帮我。



我想要的输出如下;



列表框1列表框2 。

Ram sam

sam Suresh

Raju

Suresh



i希望listbox2选择ites(sam和Suresh)保存在数据库中。当我点击sam和suresh保存按钮保存在数据库中时。





我该怎么办。



请帮帮我。

解决方案

如果你能定义你需要帮助的部分会更容易(选择lis t盒子物品或将它们保存到数据库中。



但是,这里有一些可能对你有帮助的链接 -

< a href =http://www.c-sharpcorner.com/blogs/8236/insert-all-the-selected-items-from-the-listbox-to-a-database.aspx> http:// www .c-sharpcorner.com / blogs / 8236 / insert-all-the-selected-items-from-the listbox-to-a-database.aspx [ ^ ]

从列表框插入数据进入C#数据库 [ ^ ]

http: //www.java2s.com/Tutorial/CSharp/ 0560__ADO.Net/ReaddatafromdatabasetableaddittoaListBox.htm [ ^ ]

i have two list box as follows;

List box1 and list box2.

when i select list box1 selected items it goes to list box2.

that coding is working fine no problem.

But i want List box2 selected items to be saved in the data base.

how can i do.

please help me.

Ouput i want as follows;

List box1 list box2.
Ram sam
sam Suresh
Raju
Suresh

i want to listbox2 selected ites(sam and Suresh) to be save in the data base.when i click the save button that sam and suresh to be save in the data base.


how can i do.

please help me.

解决方案

It would be easier if you could define which part you needed help with (selecting list box items or saving them to the database).

However, here are some links that might be of assistance to you -
http://www.c-sharpcorner.com/blogs/8236/insert-all-the-selected-items-from-the-listbox-to-a-database.aspx[^]
Inserting data from listbox into database in C#[^]
http://www.java2s.com/Tutorial/CSharp/0560__ADO.Net/ReaddatafromdatabasetableaddittoaListBox.htm[^]


这篇关于如何将列表框中选定的项目保存到数据库中。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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