日期:2014-05-20  浏览次数:20444 次

多选ListBox怎样绑定到数据库?
我这里有个多选的ListBox,需要把选定的值存储到数据库中,以后还需要读取出来能够编辑。
一般的TextBox绑定Text属性就可以了,多选的ListBox怎么绑定呢?

------解决方案--------------------
foreach (ListItem item in ListBox1.Items)
{
if (item.Selected)
{
string s = item.Value; //.Text?
Label1.Text =s + Label1.Text;
}
}