I am trying to get the value of the selected item in the listbox using the code below, but it is always returning null string.
DataSet ds = searchforPrice(Convert.ToString(listBox1.SelectedItem));
Here I am trying to pass the value of selected item as string to method searchforPrice to retrive dataset from the database.
How can i retrive the value of selected item as string?
I am adding items to listbox from combo box which in turn loads the items from the database.
listBox1.Items.Add(comboBox2.Text);
Anybody has answer for this..
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…