Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old August 12th, 2004, 02:07 PM
Registered User
Join Date: May 2004
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Joining Two DataSets

Let's say that I am having two Dataset objects ds1 and ds2. These DataSets have exactly the same schema. Same DataTable (only one) in each DataSet and same DataColumns. Can anyone tell me, how can I join these two DataSets into a third one, so that the new one will have the DataRows of ds1.Tables[0] followed by the DataRows of ds2.Tables[0]?

The language I am writing the project is C#.

Old August 12th, 2004, 03:02 PM
Friend of Wrox
Join Date: Jul 2004
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post

I think if you have all of your table in a unique DataSet object then you can work with them better and easier...
i.e you can make a relation(DataRealation object)between two DataTable objects in your unique dataset object then you can through two loops get your results in third DataTable object
I am not sure if its possible between two datatable objects in different dataset objects.
wait for other opinions.

Old August 12th, 2004, 03:55 PM
Friend of Wrox
Join Date: Jun 2003
Posts: 540
Thanks: 0
Thanked 4 Times in 4 Posts

Is there a reason why you don't join these in SQL?

Old August 13th, 2004, 07:28 AM
Friend of Wrox
Join Date: Oct 2003
Posts: 218
Thanks: 0
Thanked 0 Times in 0 Posts

I would recommend using the UNION function in SQL. That is,

SELECT column1, column2
FROM table1


SELECT column1, column2
FROM table2

That will append the rows from the second SELECT to the end of the first SELECT.

- - - - - - - - - - - - - - - - - - - - - - -
In God we trust, everything else we test.
Old October 30th, 2008, 06:38 AM
Registered User
Join Date: Oct 2008
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts

Hi all,

I also have the similar requirement. I also want to add take the union of two data sets. One data set is the result of the stored procedure and another is the result of one API.

Kindly help me out.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Joining Nodes (HELP!!) MissHenesy XSLT 2 October 17th, 2006 05:26 PM
Joining Three Tables Alexpizzoferro Classic ASP Databases 5 September 1st, 2006 04:08 PM
Joining 2 variables together for one name Lucy Classic ASP Basics 1 June 13th, 2006 10:01 AM
Joining 3 Queries. rupen SQL Language 1 May 11th, 2006 11:35 AM
Joining two tables rajustha SQL Server 2000 1 December 7th, 2003 07:38 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.