I have a listbox on my webform populated values from the database table. i have a List<string> variable contains some values. i need to get the strings from list<string> variable and select those strings in the Listbox.
Here's the code i tried, but it gives me a error as object reference not set to an instance of the object.
foreach (string s in Theatres)
TheaterListbox.SelectedItem.Text = s.ToString(); ---Getting Error in this line
Please help me out in this. Thanks