473,416 Members | 1,760 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 software developers and data experts.

Merging datasets

I've got two datasets, each containing a single data table.

dstDataSetA.Tables("TableA")
dstDataSetB.Tables("TableB")

I want to merge them together and delete any non-matching rows.

dstDataSetB.Merge(dstDataSetA) doesn't do this.

Any ideas or suggestions gratefully received.


Nov 18 '05 #1
2 1340
Dan,
The rules for merging datasets are :
* All the columns must be present in both datasets
* The data types of all the columns in the datasets must be same
* The column name should match.
* The table also should be the same for both datasets.I mean data table
name in the dataset.
In your case check to see if the above rules satisfy and

one rule is definetly failing :
if
dstDataSetA.Tables("TableA")
dstDataSetB.Tables("TableB")
THEN
dstDataSetB.Merge(dstDataSetA) WILL NOT WORK !!
if
dstDataSetA.Tables("TableA")
dstDataSetB.Tables("TableA")
THEN
dstDataSetB.Merge(dstDataSetA) WILL WORK !!

You might be little confused..
When you fill the dataset .
Command.Fill(dstDataSetA,"TableA");

Command.Fill(dstDataSetB,"TableA");
This is the way to go..

I am not giving the full ADO.NET code which you might already know.
Hope this helps.
Regards,
Marshal Antony
http://dotnetmarshal.com





"Dan Cooper" <da********@dontspam.com> wrote in message
news:e5**************@TK2MSFTNGP09.phx.gbl...
I've got two datasets, each containing a single data table.

dstDataSetA.Tables("TableA")
dstDataSetB.Tables("TableB")

I want to merge them together and delete any non-matching rows.

dstDataSetB.Merge(dstDataSetA) doesn't do this.

Any ideas or suggestions gratefully received.

Nov 18 '05 #2

"Dan Cooper" <da********@dontspam.com> wrote in message
news:e5**************@TK2MSFTNGP09.phx.gbl...
I've got two datasets, each containing a single data table.

dstDataSetA.Tables("TableA")
dstDataSetB.Tables("TableB")

I want to merge them together and delete any non-matching rows.

dstDataSetB.Merge(dstDataSetA) doesn't do this.

Any ideas or suggestions gratefully received.

Nov 18 '05 #3

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

Similar topics

6
by: Jon Bosker | last post by:
Help! This is probably easy but I just don't get it. I am trying to relate and merge 2 datasets. My XML file has 2 datasets (1st level nodes) TimeDetail and TimeSummary. The report is supposed to...
0
by: tonidapogi | last post by:
Hi! I'm having problems in updating my client database using web service. When I merge datasets (1 from the client and 1 from the web service), and try to update the client database by using the...
2
by: Klatuu | last post by:
Whew, I've struggled my way through figuring out how to use XML to transport data..now I can imagine what having a baby is like :) But, I'm stuck now. I generate the XML (single table, no...
0
by: Walt Borders | last post by:
Hi, My problem: Merging two datasets deletes parent elements, preserves all children. I've created two dataSets. Each use the same schema, parent-child nested tables. The first dataSet is...
3
by: Mike | last post by:
Hi! I also asked this question in C# group with no results: I have 2 datasets loaded with data from two xml files having the same schema. The files contain data from yesterday and today. I'd...
0
by: Kjetil | last post by:
Hi! I've got a WebService supplying me with a dataset: Webservice: DataSet ds = new DataSet(); OdbcDataAdapter adapter = new OdbcDataAdapter(select,connect); adapter.MissingSchemaAction =...
0
by: Mike | last post by:
Hi! I have 2 datasets loaded with data from two xml files having the same schema. The files contain data from yesterday and today. I'd like to merge both datasets in such a way that the resulting...
2
by: Phil Townsend | last post by:
I am working in a web app that contains two datasets that are cached. I would like to pull the first table from each dataset and put each into a single dataset, so as to have a single dataset with...
7
by: Jon Vaughan | last post by:
I have 2 datasets , one returned as a dataset from a webservice and one created client side form the same stored procedure that is returned from the webservice. I then try and merge the data, but...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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...
0
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.