Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Deleting Multiple Rows

Reply
Thread Tools

Deleting Multiple Rows

 
 
Stephen Noronha
Guest
Posts: n/a
 
      02-19-2004
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


 
Reply With Quote
 
 
 
 
Marshal Antony
Guest
Posts: n/a
 
      02-20-2004
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[i].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" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...

> 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
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Deleting multiple rows in Datagrid Nazar ASP .Net 0 08-14-2010 07:23 AM
Deleting a File from Hardrive and Deleting a SubKey in Registry Harry Barker C++ 2 04-19-2006 09:34 AM
Deleting multiple records(rows) from tables using checkboxes Patrick.O.Ige ASP .Net 0 11-03-2005 11:41 PM
showing multiple values from multiple db rows in a DropDownList Schultz ASP .Net 1 02-14-2005 12:38 AM
Deleting multiple rows (Hotmail style datagrid) Darren ASP .Net Datagrid Control 0 01-21-2005 01:09 PM



Advertisments