Click here to Skip to main content
15,867,453 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hai All,

How we can combine two datatable into one, both fields are same type ie, name & number fields are string type.
ie table1 + table 2 = table3;
table1 contain field name as name
and table2 contain field name as number
but i need table3 as name, number. plz refer the image below..


refer this image http://snag.gy/jshtM.jpg[^]
Posted
Updated 12-Dec-12 21:15pm
v3

use datatable.merge(//other datatable)..
 
Share this answer
 
Don't tell us that it's urgent that you can't do your job.

Depending on what you mean by 'table', you can join tables in SQL, you can copy data from one table to another, or you can just create a collection of objects that includes the data from both tables.
 
Share this answer
 
Create a new table that contains two columns ,then get the value from the other tables .
 
Share this answer
 
One of the easiest ways is to use natural join.

The SQL NATURAL JOIN is a type of equi-join and is structured in such a way that, columns with same name of associate tables will appear once only.

For example:
SELECT * FROM table1 NATURAL JOIN table 2;
 
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