HighTechTalks DotNet Forums  

Deleting rows in dataset

Dotnet Framework (ADO.net) microsoft.public.dotnet.framework.adonet


Discuss Deleting rows in dataset in the Dotnet Framework (ADO.net) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
dotnetlover
 
Posts: n/a

Default Deleting rows in dataset - 01-03-2006 , 02:15 PM






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.

Reply With Quote
  #2  
Old   
Miha Markic [MVP C#]
 
Posts: n/a

Default Re: Deleting rows in dataset - 01-03-2006 , 03:16 PM






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/

"dotnetlover" <dotnetlover (AT) discussions (DOT) microsoft.com> wrote

Quote:
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.



Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.