PC Review


Reply
Thread Tools Rate Thread

Comparing two datasets with the same schema and returning the changes

 
 
Zzzbla
Guest
Posts: n/a
 
      29th Jun 2005
Hi,

I'm writing a program that communicates with a database and a service
that contains a collection of jobs. The database is used as a copy of
the queue for interaction with legacy software. So the purpose of the
program is to synchronize the service's collection with a table on the
database.

The users will be inserting and updating rows in the table and they
will also be querying it for jobs' statuses, so the synchronization is
bidirectional.

I don't have any problems with receiving changes from the service and
updating them in the database.

The solution I'm working on for receiving the users's inserts and
updates to the table is as follows:

1. query the table (--> ds1)
2. after a set interval, query the table again. (--> ds2)
3. compare ds1 and ds2 for changes: new rows are to be inserted to the
service's collection and rows with changes will be updated in the
collection.

The primary key in both datasets is set.

Now the only problem left is to find out what's been changed. I tried
ds1.Merge(ds2) and then ds1.GetChanges() but it either returns the
whole ds1 (if I set preserveChanges = true) or null (preserveChanges =
false).

How do I make it return only the rows I need? (or is it not the right
way to do it?)

Thanks in advance,
Zzzbla
 
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
comparing DataSets? Leon_Amirreza Microsoft Dot NET Framework 2 16th Aug 2007 04:48 PM
Comparing Datasets =?Utf-8?B?SmFtZXNXaWxjZQ==?= Microsoft C# .NET 3 29th Mar 2005 03:12 PM
what's the difference between xml schema and datasets? Elhanan Maayan Microsoft ADO .NET 1 1st Aug 2004 09:22 AM
Typed DataSets and XML Schema Chuck Bowling Microsoft C# .NET 0 24th Apr 2004 05:12 PM
Comparing two datasets Eric Microsoft C# .NET 1 20th Feb 2004 02:51 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:16 AM.