Re: insert multiple records using asp.net

Discussion in 'ASP .Net' started by Michael Ramey, Jan 30, 2004.

  1. Well you are only going to be able to insert one record at a time. Create
    some nested loops to handle situations where both might be all.

    if b = "all" and c="all" then

    for each val in b
    for each val in c
    'insert code
    next
    next

    elseif b="all"

    for each val in b
    'insert code
    next

    elseif c="all"

    for each val in c
    'insert code
    next

    end if

    HTH,
    --Michael

    "Sileesh" <> wrote in message
    news:...
    > Hi
    >
    > Can any one help me out or give me some code of how to proceed.
    >
    > The scenario is
    >
    > I have 3 Dropdown List boxes. Let's say A, B and C. I am populating B

    based on the selection In A. And C is populated based on selection In B.
    >
    > Based On Dorpdown List "C", I am getting records from the Database and

    displayig in an HTMl Table.
    >
    > Now I have To Add an option "All" to The Dropdown Lists B and C. That

    Means If "All" is selected in "B", then i have To insert a record in
    database for each item in "C" to all items in "B".
    >
    > for ex: if i have 2 items in A, 3 items(exclu "All") in B and n Items(Excl

    All) ( for each item in B) in C . Now If i select All In B then i have
    insert "(n*1st Item)+(n*2nd Item)+(n*3rd Item)" records in Database at one
    shot. I am using SQL server 2000
    >
    > How do i do this.
    >
    > Thx in advance
     
    Michael Ramey, Jan 30, 2004
    #1
    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. Vijay Pathak via .NET 247

    Insert Multiple Records at a time based on checkbox selection

    Vijay Pathak via .NET 247, Sep 22, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    575
    Vijay Pathak via .NET 247
    Sep 22, 2004
  2. Ian Macey
    Replies:
    1
    Views:
    901
    =?Utf-8?B?U2NvdHQgU2ltb25z?=
    Jan 25, 2005
  3. Replies:
    3
    Views:
    7,778
    elizas
    Apr 27, 2010
  4. Replies:
    1
    Views:
    1,788
    Albert Hopkins
    Dec 6, 2008
  5. shank

    insert multiple records

    shank, Feb 21, 2004, in forum: ASP General
    Replies:
    10
    Views:
    287
    Chris Barber
    Feb 22, 2004
Loading...

Share This Page