PC Review


Reply
Thread Tools Rate Thread

Delete a group of records in a DataTable.

 
 
Mufasa
Guest
Posts: n/a
 
      3rd Dec 2008
I have a datatable with a whole lot of rows in it. It's a datatable I have
manually created that I will be manipulating. I include a date as part of
the record. I want to delete everything that is older than 10 days. In SQL I
would do something like:

delete from Data where WhenDate < '12/01/2008'

How can I accomplish the same thing in .Net without spinning through all of
the records?

BTW - this dataset never is actually written to a database; it's manipulated
locally and when done it's written out to disk.

TIA - Jeff.

 
Reply With Quote
 
 
 
 
Miha Markic
Guest
Posts: n/a
 
      4th Dec 2008
You can select that group of rows using a filter or a LINQ to DataSet query
but at the end you'll have to delete them one by one.

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

"Mufasa" <(E-Mail Removed)> wrote in message
news:B7359238-2E28-45AC-B0D7-(E-Mail Removed)...
>I have a datatable with a whole lot of rows in it. It's a datatable I have
>manually created that I will be manipulating. I include a date as part of
>the record. I want to delete everything that is older than 10 days. In SQL
>I would do something like:
>
> delete from Data where WhenDate < '12/01/2008'
>
> How can I accomplish the same thing in .Net without spinning through all
> of the records?
>
> BTW - this dataset never is actually written to a database; it's
> manipulated locally and when done it's written out to disk.
>
> TIA - Jeff.
>


 
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
Copying records from datatable to datatable in dataset tshad Microsoft C# .NET 1 24th Jun 2008 01:39 AM
DataTable.Select - Group By Doug Microsoft ADO .NET 1 11th May 2007 09:14 PM
Delete a group of records in VB won't work Tim Crowley via AccessMonster.com Microsoft Access VBA Modules 5 14th May 2005 06:21 AM
Using DCount in Group Footer filtering records based on value of the group Beth Microsoft Access Reports 1 10th Sep 2004 04:17 PM
Group By in DataTable? Oka Morikawa Microsoft ADO .NET 4 22nd May 2004 06:21 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:37 PM.