Click here to Skip to main content
15,992,922 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
use of dataset to merge two table and store into another table .

and also view the new updated(another) table in gridview
Posted
Comments
George Jonsson 8-Jul-14 7:00am    
Do you mean that you have two data tables in a dataset and want to merge both into a third table?
IS the third table inside or outside the dataset?
10923679 9-Jul-14 1:16am    
i have two tables in database.
i have to merge both and make it one and store that new updated data to another table in database.

for eg
table 1-

slno name roll
1 a 1001
2 c 1254

table 2-

slno roll age
1 1001 20
2 1254 15

table 3-(new table)

slno name roll age
1 a 1001 20
2 c 1254 10 in another new table in databse


now i guess u have an idea..
can u help me to implement in asp.net
George Jonsson 9-Jul-14 2:06am    
Next time post information like this in your original question.
Much easier to help you with relevant info at hand.

C#
DataTable dtAll = ds.Tables[0].Copy();
dtAll.Merge(ds.Tables[1]);
ds.Tables.Add(dtAll);
gridview1.DataSource =ds.Tables[2];
gridview1.DataBind();
 
Share this answer
 
v2
check this ..


Merge Dataset[^]

Merging dataset[^]
 
Share this answer
 

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