Jump to content

how to store data to database


Guest eexl84

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...