listbox and sql stored procedure

  • Thread starter Thread starter John
  • Start date Start date
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
 
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
 
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.
 
Back
Top