如何在string中存储列表框值 [英] how to store listbox values in string
本文介绍了如何在string中存储列表框值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在列表框中有学生ID值列表。
在列表框中学生ID如下
10
20
30
40
50
60 >
70
i想将上面的列表框值存储到字符串中。
问候,
Narasiman P.
i have list of student id values in listbox.
In listbox student id as follows
10
20
30
40
50
60
70
i want to store the above listbox values into string.
Regards,
Narasiman P.
推荐答案
你可以试试这个.......... ....
http://forums.asp.net/t/1862544.aspx?How+to+store+List+string+values+into+database [ ^ ]
You Can Try This ..............
http://forums.asp.net/t/1862544.aspx?How+to+store+List+string+values+into+database[^]
你可以用这样的字符串绑定它
You can bind it in string like this
string listData = string.Empty;
foreach (object item in listBox1.Items)
{
listData = item.ToString() + "," + listData;
}
Response.Write(listData);
这篇关于如何在string中存储列表框值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文