Click here to Skip to main content
15,886,518 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Assume that I have two datatables:

the first DataTable is like the following

C#
AID | Title 
-----------------
1  | Technology 
2  | Science 
3  | Asp.net 


The second DataTable is like the following

C#
AID | WID | Matching 
------------------------
1   | 1   | 17 
1   | 4   | 19 
2   | 5   | 22 
3   | 6   | 25


the merge dataTable DataTable I want like the following but sorted by Matching

C#
AID  |  Title      |  WID  |  Matching 
------------------------------------------
1    | Technology  |  1    |  17 
1    | Technology  |  4    |  19 
2    | Science     |  5    |  22
3    | Asp.net     |  6    |  25
Posted
Updated 22-May-14 5:08am
v2

SQL
select AID,Title,WID,Matching from table1
inner join table2 on AID.table1=AID.table2
 
Share this answer
 
v2
Comments
Maciej Los 22-May-14 11:44am    
+5
For merging two datatables that have different schema see this post on SO[^]

As for sorting it ... some suggestions here[^]
 
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