Solved

Combine 2 datasets.

Posted on 2004-08-18
3
197 Views
Last Modified: 2010-04-15
How do I combine two datasets.
thanks,
Ghost
0
Comment
Question by:copyPasteGhost
3 Comments
 
LVL 9

Assisted Solution

by:s_sansanwal
s_sansanwal earned 100 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 150 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

920 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now