Interview Question in SQL Server Indexing


 

Interview Question :: Multi-Select Boxes amp; SelectedIndex in cSharp


I have a program that has some multi-select boxes that will gather information about delimiting values in an SQL query. I need to be able to find out which items in the listbox are selected. The following command is useful for only retrieving the value of the first selected index

Level.Items[Level.SelectedIndex].ToStr...

Please help. Multi-Select box is called Level.
Answers to "Multi-Select Boxes amp; SelectedIndex in cSharp"
RE: Multi-Select Boxes amp; SelectedIndex in cSharp?

I couldn't understand the code you are giving because some lines has been cut by yahoo. But at least i know what you want to do.



This few lines of code will show you how to get the data of the selected items in a list box :



string str = "";

foreach (object obj in listBox1.SelectedItems)

str += " " + obj;

MessageBox.Show(str);



Of course the use of the string is to show you how to use the values nothing more.





funkymido,
 
Vote for this answer ::  
Update Alert Setting