473,387 Members | 1,721 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

listbox and sql stored procedure

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
Nov 18 '05 #1
2 1517
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

"John" <st********@yahoo.com> wrote in message
news:uD**************@tk2msftngp13.phx.gbl...
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

Nov 18 '05 #2
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.

"Eliyahu Goldin" wrote:
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

"John" <st********@yahoo.com> wrote in message
news:uD**************@tk2msftngp13.phx.gbl...
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


Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Chris | last post by:
Hi, I have an application written in ASP and I am converting to ASP.NET in the old ASP page users can add items to a listbox control. When the user hits the "submit" command button on the...
1
by: Jeff Thur | last post by:
I have a listbox with all the US States. I need the user to select multiple States from that listbox and pass them on as parameters to a SQL Stored Procedure that will give them a count of all the...
2
by: Not Me | last post by:
Hey, Coming back to a piece of work I did a while back, which used a stored procedure to populate a list box. The SP takes a single parameter, and I think this is the reasoning for using 'exec'...
1
by: r3net | last post by:
I need to pass a parameter @item to a stored procedure and get back a selection based on value(s) contained in @item. @item is a collection of selected items in a listbox as follows......
8
by: Steve Schroeder | last post by:
For some reason I cannot get the OnSelectedIndexChanged event to fire for a listbox I have on a page. I'm able to populate the listbox with data from a stored procedure, but cannot trigger the...
1
by: karups | last post by:
Hi, 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...
2
by: gayano | last post by:
Hi all, I have a stored procedure (and im using .net) ALTER PROCEDURE dbo.DriveSearch @Driver varchar(50) AS SELECT Name,Furi FROM Driver
4
by: gayano | last post by:
Hi I'm Tried Lot's of forums but still no Answer Can you guys help me? What i have is a Stored procedure looks like this ALTER PROCEDURE dbo.DriveSearch @Driver varchar(50) AS SELECT...
6
by: binky | last post by:
Good afternoon folks, I have a performance question if anybody might have suggestions. Functionally, everything i'm about to describe works as intended. The only problem I'm having is speed. ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.