I have a Multiple Select listbox with values for eg: a, b, c, d, e etc. If I select a,b,c from the listbox, I should be able to make a select query based on that. Like this: select a,b,c from table.
what should I do to collect the values from the listbox and reproduce them to the select query?
I am able to collect the values using a for loop and I am not sure whether to add that in a vector or something to reproduce in the select query.
Code I have wriiten so far:
Mcol_lst is the name of the listbox.
String[] sele = request.getParameterValues("Mcol_lst");
if(sele !=null) {
for(int i=0;i<sele.length;i++) {
System.out.println("dffdsfsdf"+i);
vec.add(params[i]);
}
}
rs=st.executeQuery("Select ["+request.getParameterValues("Mcol_lst")+"] from [Base Inventory Table]);
There should be a "comma" after each item selected to do the select query, how should I get that?
I am using JSP and Beans but I guess I can manipulate ASP/
vb script code provided by you in the way I want.
Please help,
Thanks