如何向从列表框中选择的表中插入多个值 [英] How do i insert multiple values to the table which i selected from listbox

查看:133
本文介绍了如何向从列表框中选择的表中插入多个值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如:如果我选择了两个值,那么我必须插入两个相应的列

for eg: if i selected two values then i have to insert into two respective columns

推荐答案

连接您的选择,用任何空格字符分隔,如(,#。 )并在从数据库中获取值时存储在列中反转过程...
concatenate your selection separated with any spacial character like (, # .) and store in column while fetching value from database invert the process ...


Add Selected  values from listbox then you decide column you do add in table columns
<pre lang="cs">
foreach (string item in lstbox.SelectedItems)
           {
               lst.Items.Add(item);
           }
</pre>




.


这篇关于如何向从列表框中选择的表中插入多个值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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