listbox and sql stored procedure

Discussion in 'ASP .Net' started by John, Jun 30, 2004.

  1. John

    John Guest

    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
    John, Jun 30, 2004
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:...
    > 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
    >
    >
    Eliyahu Goldin, Jul 1, 2004
    #2
    1. Advertising

  3. 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" <> wrote in message
    > news:...
    > > 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
    > >
    > >

    >
    >
    >
    =?Utf-8?B?RGVlcA==?=, Jul 9, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?VGltOjouLg==?=

    Stored Procedure and SQL String????

    =?Utf-8?B?VGltOjouLg==?=, Mar 1, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    2,492
    =?Utf-8?B?VGltOjouLg==?=
    Mar 1, 2005
  2. Mike P
    Replies:
    0
    Views:
    3,297
    Mike P
    Jun 19, 2006
  3. John

    listbox and sql stored procedure

    John, Jun 30, 2004, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    140
    DalePres
    Jul 2, 2004
  4. John

    listbox and sql stored procedure

    John, Jun 30, 2004, in forum: ASP .Net Security
    Replies:
    0
    Views:
    119
  5. John

    listbox and sql stored procedure

    John, Jun 30, 2004, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    122
    Scott G.
    Jun 30, 2004
Loading...

Share This Page