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(Co
If you are using ListBox in your application and you want to return the selected value of ListBox and display it in a Label or any thing else then use this code, it will help you
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
label1.Text = listBox1.SelectedItem.ToString();
}