Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Combine 2 datasets.

Posted on 2004-08-18
3
Medium Priority
?
204 Views
Last Modified: 2010-04-15
How do I combine two datasets.
thanks,
Ghost
0
Comment
Question by:copyPasteGhost
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 9

Assisted Solution

by:s_sansanwal
s_sansanwal earned 400 total points
ID: 11837477
Use DataSet Merge method
Refer
http://authors.aspalliance.com/aspxtreme/sys/Data/datasetclassmerge.aspx

Cheers,
S Sansanwal
0
 
LVL 10

Accepted Solution

by:
eternal_21 earned 600 total points
ID: 11842387
Here is an example:

  static System.Data.DataSet Combine(params System.Data.DataSet[] dataSets)
  {
    System.Data.DataSet dataSet;
    dataSet = new System.Data.DataSet();
 
    foreach(System.Data.DataSet pDataSet in dataSets)
      dataSet.Merge(pDataSet);
                  
    return dataSet;
  }

You can call it as:

  Combine(dataSet1, dataSet2, ...), and it will return a DataSet that has all the requested DataSets combined.
0
 
LVL 13

Author Comment

by:copyPasteGhost
ID: 11842956
thanks
to the both of you
Ghost
0

Featured Post

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question