Home All Groups Group Topic Archive Search About

Deleting rows in dataset

Author
3 Jan 2006 7:15 PM
dotnetlover
How can i delete a row in dataset based on the column value, i have four
columns in a row and i want to delete the row based on the column1 value.

Author
3 Jan 2006 8:16 PM
Miha Markic [MVP C#]
Hi,

Select the rows you wish to delete (perhaps using DataTable.Select method or
dataview) and do an inverse for loop (from latest row to first row) - inside
the loop call DataRow.Delete method.
And, of course, call DataAdapter.Update to persist the changes in database
if you wish.

--
Miha Markic [MVP C#]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

Show quote
"dotnetlover" <dotnetlo***@discussions.microsoft.com> wrote in message
news:5B8E459B-11EF-4250-930B-89A3A8A21468@microsoft.com...
> How can i delete a row in dataset based on the column value, i have four
> columns in a row and i want to delete the row based on the column1 value.

AddThis Social Bookmark Button