Comparing two datasets

  • Thread starter Thread starter Eric
  • Start date Start date
E

Eric

Hello,

I am trying to write a webservice to compare 2 datasets, one recieved
from a client, and the other taken from a database on the webserver.

Sofar, I have had little success in accomplishing that, but that may
be due to the fact that I'm a relative newbie on C# :-)

Does anybody have a clue, a hint, or maybe even some sample code?

Thanks in advance
 
Hi
i just had this idea that you might want to try
First try to get a copy of one of your datasets in an new dataset lets say
you have datasets D1 & D2
DataSet copy = D1;
Set use accept changes on copy so you preserve its state
copy.AcceptChanges();//we did that so when we do the merge we know that
changes in //the copy will only come from D2
Then make "copy" equal to the merge of D1 and D2 ,since it already has D1
so you will do the following
Copy.Merge(D2);//make copy a merge to D1 and D2
Then we get the changes that happed on copy by the merge on a new dataset
" lets say changes
DataSet Changes = copy.GetChanges();
Then we see if changes has no data then we know that the 2 dataset
origanlly had the samedata ( me be we should apply AcceptChanges on D2 as
well before we do the merge )
Hope this solution meet your needs
 
Back
Top