0
我需要將兩個數據表合併到C#3.5版本的一個公共數據表中。我嘗試像dt1.merge(dt2)合併操作。但它將datatable2值附加到datatable1的底部。但我需要像下面的格式。將兩個數據表連接到一個數據表
DataTable1
Column1 Column2 Column3
1 Row1 Row2
2 Row3 Row4
DataTable2
Column4 Column5 Column6
1 Row5 Row6
2 Row7 Row8
合力表應該是這樣
DataTable1
Column1 Column2 Column3 Column5 Column6
1 Row1 Row2 Row5 Row6
2 Row3 Row4 Row7 Row8
任何幫助,將理解
讓我們看看你有什麼到目前爲止 –
你有你的答案在這裏http://stackoverflow.com/questions/12628020/merging-2-datatables-in-to-1-datatable-with-相同的行數 – Ehsan
看起來像你想要的是在一個內部聯接,可能的答案http://stackoverflow.com/questions/665754/inner-join-of-datatables-in-c-sharp – crafty