How to merge two dataset in a single DataGrid to show rows from bouth datasets.....

Posted on 2008-10-28
Last Modified: 2013-12-17

I want to merge two datasets into one single grid, and show rows from bouth datasets in the grid.....
now when run my app nothin will appear in the grid..i have done someting wrong here, can somone guide me here...?!

private void Reset()
            gridImports.AutoGenerateColumns = false;
            DataSet myDsFilesToUndo = AmEngine.Instance.GetUnreconciledImpFiles(myOperator);
            DataSet importedReconsiledfiles = AmEngine.Instance.GetReconciledImpFiles(myOperator);
            gridImports.DataSource = myDsFilesToUndo.Tables[0];
            gridImports.DataSource = importedReconsiledfiles.Tables[0];
            int test = myDsFilesToUndo.Tables[0].Rows.Count;
            int test1 = importedReconsiledfiles.Tables[0].Rows.Count;
            //dataSet1.Merge(dataSet2, False, MissingSchemaAction.Add);
            gridImports.DataSource = myDsFilesToUndo;
            myDsFilesToUndo.Tables[0].Columns.Add(new DataColumn("ClientCount", typeof(int)));
            if (myDsFilesToUndo.Tables[0].Rows.Count > 0)
                btnUndoImport.Enabled = true;
                foreach (DataRow idxRow in myDsFilesToUndo.Tables[0].Rows)
                    int fileId = (int)idxRow["ImpFile_ID"];
                    int clientCount = AmEngine.Instance.GetClientCountForImpfile(fileId.ToString());
                    idxRow["ClientCount"] = clientCount;
                btnUndoImport.Enabled = false;

Open in new window

Question by:Adnan

Accepted Solution

dampsey earned 500 total points
ID: 22820642
           DataSet dataset1 = new DataSet();
            DataSet dataset2 = new DataSet();
            GridView1.DataSource = dataset1.Tables[0];

Author Closing Comment

ID: 31510687
NICE ;) Thanks dampsey

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
RegEx with optional part 4 42
JSON Deserialize issue 6 26
Using data from certificate to re-create certificate programmatically 3 27
Why use this lambda? 12 41
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…

821 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