Click here to Skip to main content
15,891,689 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
<b></b>i thanks for reading the thread, i am using C#.
I have 2 datasets,& i have to merge them in the 1st one dataset like as

lets say <b>TABLE A</b> has columns name
ID      LoanID Firstname  lastname
1         1       abc       xhs
2         2       ali       naeem
3         3       khan      rock
4         4       sami      rock1
5         5       sameer    rock2
6         6       khan1     rock3
<b>TABLE B</b>  has columns name
OrgID  LoanID  Created BY
1         2       abc1
2         2       ali1
3         4      khan21
4         6       sami21
5         6       sameer213
6         6       khan1213
Now the destination <b>TABLE A</b> (if LoanID in the TAbleB then) <b>TABLE C would have column value otherwise no value</b>
ID  LoanID Firstname     lastname      OrgID  LoanID  CreatedBY
1         1       abc       xhs
2         2       ali       naeem
3         2       ali       naeem       2      2       abc1
4         2       ali       naeem       2      2       ali1
5         3       khan      rock
6         4       sami      rock1
7         4       sami      rock1       3      4      khan21
8         5       sameer    rock2
now total four rows for loanid=6 and so on



kindly give me idea ,I am new in programming.
Posted
Updated 2-Nov-12 8:33am
v2
Comments
Thomas Daniels 2-Nov-12 12:57pm    
Which programming language do you use?
Ali_100 2-Nov-12 13:00pm    
I am using C#,just wait i am improving the question
fjdiewornncalwe 2-Nov-12 12:58pm    
Is this a database question(ie. sql)?

1 solution

Hi,

You can use the DataSet.Merge method:
http://msdn.microsoft.com/en-us/library/4swwh51k.aspx[^]

If you do that, you don't create a third DataSet.
So, copy the first DataSet and merge the copied DataSet with the second DataSet:
C#
DataSet dataset3 = dataset1.Copy();
// now, merge dataset3 with dataset2, and you'll find the merged result in dataset3

Hope this helps.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900