Solved

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

Posted on 2008-10-28
2
540 Views
Last Modified: 2013-12-17
Hi

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...?!

thanks...
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;
 

            myDsFilesToUndo.Merge(importedReconsiledfiles);

            //**********

            //dataSet1.Merge(dataSet2, False, MissingSchemaAction.Add);

            gridImports.DataSource = myDsFilesToUndo;

       

            //***********
 

            myDsFilesToUndo.Tables[0].Columns.Add(new DataColumn("ClientCount", typeof(int)));

            myDsFilesToUndo.AcceptChanges();
 

            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;

                }

            }

            else

            {

                btnUndoImport.Enabled = false;

            }

           

        }

Open in new window

0
Comment
Question by:Adnan
2 Comments
 
LVL 8

Accepted Solution

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

Author Closing Comment

by:Adnan
ID: 31510687
NICE ;) Thanks dampsey
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

758 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

17 Experts available now in Live!

Get 1:1 Help Now