Click here to Skip to main content
15,891,316 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to pass the multiple selected values from listbox to where condition in a sql query, please help me out guys.
Posted

You need to itereate through the Listbox.SelectedItems collection to get the values and then you can pass them to the query.
 
Share this answer
 
v2
Pass it as a string with pipe delimited.
C#
string = "ABC|123|456";


Then Create a split function in SQL the split the values and use the splitted values as parameters to your WHERE condition.

Regards,
Eduard
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900