Mr_Shaw
asked on
listbox mutliselect
Has anybody ever created a Listbox with a multiselect. Then managed to pass the selected item values accross to a stored procedure as OR statements.
For example the selection is 1,2,3 therefore the SQL statement will be 1 or 2 or 3
For example the selection is 1,2,3 therefore the SQL statement will be 1 or 2 or 3
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The easiest will be to loop the selecteditems and store it in a string to pass it as a parameter
string selitems = "";
for(int cnt =0;cnt <= listBox1.SelectedItems.Cou nt -1;cnt++)
{
selitems = selitems + "," + listBox1.SelectedItems[cnt ];
}
string selitems = "";
for(int cnt =0;cnt <= listBox1.SelectedItems.Cou
{
selitems = selitems + "," + listBox1.SelectedItems[cnt
}
ASKER
thanks
Open in new window