joined:May 27, 2010
I have two Multi Select Listboxes.
The selections of the first list box are supposed to fill in the second list box from a sql database.
When one thing is selected in the first list box it populates the second list box with all data except for the first piece of data, however as soon as multiple selections are made the second list box goes blank.
My current code is:
private void LoadSequence(string partlist)
SqlCommand cmd = new SqlCommand("", conn);
cmd.CommandText = "SELECT DISTINCT apnRoutingMaster.description, apnRoutingMaster.seq_SAP " +
"FROM apnRoutingMaster INNER JOIN apnProdMaster ON apnRoutingMaster.prod_id = apnProdMaster.prod_id " +
"WHERE (apnProdMaster.vendor_code = '1000035') AND (apnRoutingMaster.description IS NOT NULL) AND (apnProdMaster.shortname IN (@partlist)) " +
"ORDER BY apnRoutingMaster.seq_SAP";
rdr = cmd.ExecuteReader();
lbxSteps.DataSource = rdr;
catch (Exception e3)
if (conn.State != ConnectionState.Closed)
protected void lbxPartType_SelectedIndexChanged(object sender, EventArgs e)
string lbxPartTypeALL = "";
foreach (ListItem li in lbxPartType.Items)
lbxPartTypeALL += li.Value + ",";
string lbxPartTypeALLTrim = lbxPartTypeALL.TrimEnd(',');
Any help that you can give would be greatly appreciated! I have been struggaling with this problem for several weeks now.