Hi All
I am getting a problem in merging two datasets into one. Both datasets have the same schema, structure but different data. One of the datasets have data with null values in some columns. But I want them to merge and the final result should be that one of the dataset has all the rows.
Fyi, the two datasets were populated with data from excel files. Both excel files have same columns. But they can have null values in some of the columns.
Please help me to resolve this issue.
Loading
SriPosted Oct 12, 2009, 5:29 PM
DataTable dtMerged = dtCurrent.Copy();
foreach (DataRow drNext in dsNext.Tables[0].Rows)
{
dtMerged.ImportRow(drNext);
}
where dtCurrent and dtNext are two datatables and dtMerged is the merged one. I tried to use the copy to get the complete structure of the required table and at the same time i got the data from the first dataset. Then used ImportRow method to get the data from the second dataset.
But now I have a small issue that is - the date columns in the datatables are showing mm//dd/yyyy hh:mm:ss instead of mm/dd/yyyy.
Roei BarPosted Oct 12, 2009, 5:14 PM
it is running on the datasets DataTables and creating a "SQL like, Full outer join"
SriPosted Oct 12, 2009, 4:41 PM
As I mentioned, the datasets have some null values in the dataset. Is there any workaround.
Roei BarPosted Oct 12, 2009, 3:42 PM
http://msdn.microsoft.com/en-us/library/aa325632%28VS.71%29.aspx