I have a drop list where you can select multiple options (at least 3) and i want to pass the selected values into an array these selected values are also shown in a text box i also have a text box called name i need to know how to take the 3 values from the array and the name entered in the text box and enter them into a database table where i have 3 columns name, e1,e2,and e3 here is what i have so far
or is there a better way to get the selected values from the drop down list and put them into the SQL database
foreach (ListItem LstItem in ListBox1.Items)
{
if (LstItem.Select ed == true)
{
TextBox2.Text += "\n" + LstItem.Text;
ArrayList list = new ArrayList();
foreach (ListItem a in ListBox1.Items)
list.Add(LstIte m.Selected);
}
else
{
Alert("No Courses Selected");
}
or is there a better way to get the selected values from the drop down list and put them into the SQL database
foreach (ListItem LstItem in ListBox1.Items)
{
if (LstItem.Select ed == true)
{
TextBox2.Text += "\n" + LstItem.Text;
ArrayList list = new ArrayList();
foreach (ListItem a in ListBox1.Items)
list.Add(LstIte m.Selected);
}
else
{
Alert("No Courses Selected");
}
Comment