listbox and sql stored procedure

J

John

Hi,
First of all sorry for my not perfect english.

I've got listbox in my .aspx page where the users can make multiple
selection.
So, Users can select 7 items in listbox, I have to take value from items and
pass it to stored procedure to delete 7 rolls in my table. Thats simple,
but what if user select 3 or 30 items in listbox? The problem is that I dont
know the number of the parameters, and how to pass them. can I use array
or is there some different solution?

Of course I can take the collection of items and for every item, I can call
stored procedure, but this is no good in performance reason.
Please help me
 
E

Eliyahu Goldin

Are you asking how to pass variable number of values to a stored procedure?
If it is the question, merge all values into one string and parse it in the
stored procedure.

Eliyahu
 
G

Guest

Deep Wrote:
Concatenate the values in a string delimited with some other string like "|" e.g.1|2|3. Pass this string to a stored procedure. Use charat function to extract individual numbers and the fire delete statements.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top