Guest eexl84 Posted February 22, 2008 Share Posted February 22, 2008 i am a new user of asp.net. my problem is like this i hv create a box list. this box list hv few item. i want to ask is i select 2 or more item from list box, and i want to store it to database. on database they just have one item display. i select two and more item from list box but they just display one item only. so, i want to know how to solve this problem. what is the coding i need to write??? Link to comment Share on other sites More sharing options...
Reg Edit Posted February 22, 2008 Share Posted February 22, 2008 i am a new user of asp.net. my problem is like this i hv create a box list. this box list hv few item. i want to ask is i select 2 or more item from list box, and i want to store it to database. on database they just have one item display. i select two and more item from list box but they just display one item only. so, i want to know how to solve this problem. what is the coding i need to write??? With a listbox in multiselect mode, the SelectedValue property only returns the first selected value. To access all the selected values, iterate through the Items collection and check the Selected property of each item:foreach (ListItem li in ListBox1.Items){ if (li.Selected) { // Use li.Value here }} If you want to know more about accessing the database, see the ADO.NET referencehttp://msdn2.microsoft.com/en-us/library/h...021(VS.80).aspx Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.