C# join 2 DataTables without LINQ
I want to join two data tab开发者_JS百科les using C# without using LINQ. How can I do it?
Are you trying to concatenate two datatables to a new one? If so, do this
DataTable result= table1.Copy();
result.Merge(table2);
where table1 and table2 are DataTables
use a single statment that joins the tables in SQL, i.e.
select * from table1 t1, table2, t2 where t1.id = t2.id
HTH
Ivo Stoykov
精彩评论