PC Review


Reply
Thread Tools Rate Thread

Deleting rows in dataset

 
 
=?Utf-8?B?ZG90bmV0bG92ZXI=?=
Guest
Posts: n/a
 
      3rd Jan 2006
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
 
 
 
 
Miha Markic [MVP C#]
Guest
Posts: n/a
 
      3rd Jan 2006
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" <(E-Mail Removed)> wrote in message
news:5B8E459B-11EF-4250-930B-(E-Mail Removed)...
> 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
Rate This Thread
Rate This Thread:

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
Problem deleting rows from dataset (VS2003, VB) marshallarts Microsoft VB .NET 3 27th Mar 2006 07:14 PM
deleting duplicate rows in a dataset =?Utf-8?B?QXNoYQ==?= Microsoft ASP .NET 1 24th Jul 2004 08:34 PM
Deleting rows from a DataTable in a DataSet =?Utf-8?B?TWljaGFlbA==?= Microsoft ADO .NET 4 23rd Jan 2004 01:43 AM
Index out of range error when deleting rows in dataset table with relationships defined between fields in the same table JerryK Microsoft ADO .NET 0 19th Sep 2003 06:17 PM
Re: copy/move rows from a dataset to another dataset? Stephen Muecke Microsoft ADO .NET 1 22nd Jul 2003 04:56 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:27 PM.