Deleting Multiple Rows

Discussion in 'ASP .Net Datagrid Control' started by Stephen Noronha, Feb 19, 2004.

  1. Hi,

    I want to delete multiple records/rows from a dataset for eg:
    DataSet.tables(0).rows("Some Counter").delete() will delete one row.
    what if I have to delete more than one row...

    Thanks,
    Stephen
     
    Stephen Noronha, Feb 19, 2004
    #1
    1. Advertising

  2. Hi Stephan,
    You can delete multiple rows by using a loop.
    Eg :

    DataSet ds=new DataSet();

    populate dataset..

    for(int i=0;i<ds.Tables[0].Rows.Count;i++)

    {

    ds.Tables[0].Rows.Delete();

    }

    This will delete all rows from a datatable(first one) in the dataset
    ..

    If you want to delete multiple rows based on some condition,put the if
    condition inside the for loop before deletion.

    HTH

    Regards,

    Marshal Antony

    ..NET Developer

    http://www.dotnetmarshal.com







    "Stephen Noronha" <> wrote in message
    news:%...

    > Hi,
    >
    > I want to delete multiple records/rows from a dataset for eg:
    > DataSet.tables(0).rows("Some Counter").delete() will delete one row.
    > what if I have to delete more than one row...
    >
    > Thanks,
    > Stephen
    >
    >
     
    Marshal Antony, Feb 20, 2004
    #2
    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. Patrick.O.Ige
    Replies:
    0
    Views:
    699
    Patrick.O.Ige
    Nov 3, 2005
  2. Harry Barker
    Replies:
    2
    Views:
    548
    Alf P. Steinbach
    Apr 19, 2006
  3. Nazar
    Replies:
    0
    Views:
    460
    Nazar
    Aug 14, 2010
  4. Darren

    Deleting multiple rows (Hotmail style datagrid)

    Darren, Jan 21, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    163
    Darren
    Jan 21, 2005
  5. crea
    Replies:
    2
    Views:
    444
    Nobody
    Dec 28, 2012
Loading...

Share This Page