Hello All,
I am newbie , am stuck in middle of the coding. I want to retrieve data from sql database when i am selecting mulitple items from listbox and showing on another listbox in vb.net.
My code only retrieving only one item from listbox and retrieve data from database and showing on another listbox. I am attaching my code with this mail.
Please help me out!
Retrieving data from database using multiple items from listbox and showing on another listbox
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Mayur DigheRank #1,078 · 1.8K reputationPosted Apr 22, 2012, 7:27 AM EDT
You can do this .........
just make sure that you have assigned the ListBox's SelectionMode property to
MultiSimple.
Your current code will not work IF SelectionMode is NOT set properly....
so do the required changes...........
Vigin Kurakar6 reputationPosted Apr 25, 2012, 8:28 AM EDT
Mayur DigheRank #1,078 · 1.8K reputationPosted May 5, 2012, 7:22 AM EDT
Hey Vigin, You can do this ......... BUT first sorry for delay......... Now, turn to the Programming....... here I place the sample Code line for ur work.... listBox1.SelectionMode = SelectionMode.MultiSimple; //MultiSimple :- Multiple items can be selected. ----OR----- listBox1.SelectionMode = SelectionMode.MultiExtended; //MultiExtended :- Multiple items can be selected, and the user can use the SHIFT, CTRL, and arrow keys to make selections