473,480 Members | 1,982 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Comparing two datasets

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
Nov 15 '05 #1
1 10391
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
Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
385
by: jacew | last post by:
I want to compare two datasets and retireive the differences. Is the an easy way to do this without trawling through the all records and fields? The basic problem is this. I get a dataset and copy...
4
1724
by: Alpha | last post by:
I have a small Window application and through out the different forms I create a different dataset. At the begining I used the Tools to drag and drop the SqlDataAdapter, connection and dataset...
0
1266
by: Elliot M. Rodriguez | last post by:
I can accomplish this relatively easily but inefficiently, and it seems like a hack, but I cant think of a better workaround. Hopefully someone else here can. My task is to perform an update on...
19
2953
by: Will Lastname | last post by:
In one of the applications that I'm working on I have 2 sets of functions that build different datasets. Imagine 4 columns in a datagrid. Inside those 4 columns I have nested datalists. Two of...
9
2878
by: GaryDean | last post by:
We have been noticing that questions on vs.2005/2.0 don't appear to get much in answers so I'm reposting some questions posted by some of the programmers here in our organization that never got...
4
3696
by: Frank | last post by:
Hello, Developing an app where the user fills out a sometimes quite lengthy form of chkboxes, txtboxes, radbtns, etc. User responses are saved to a mySql db, which the user can later edit. When...
0
1202
by: S.Tedeschi | last post by:
Hi all; as posted some days ago, I'm converting an on-line app; I used to heavily rely on strongly-typed DataSets directly dropped onto pages, and so viewed by code(-behind) as well. In the next...
5
1835
by: Franck | last post by:
how come unchanged always true even if data changed This code come from my saving button: ============================================ DataSet ds1 = new DataSet(); DataSet ds2 = new...
12
3549
by: BillE | last post by:
I'm trying to decide if it is better to use typed datasets or business objects, so I would appreciate any thoughts from someone with more experience. When I use a business object to populate a...
0
7054
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6918
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7057
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7102
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6756
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7003
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
3000
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
570
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
199
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.