//原本的兩個datatable1和datatable2DataTable DataTable1, DataTable2//兩個結構一樣的DT合併DataTable newDataTable = DataTable1.Clone();object[] obj = new object[newDataTable.Columns.Count];for (int i = 0; i < DataTable1.Rows.Count; i++){ DataTable1.Rows[i].ItemArray.CopyTo(obj,0); newDataTable.Rows.Add(obj);}for (int i = 0; i < DataTable2.Rows.Count; i++){ DataTable2.Rows[i].ItemArray.CopyTo(obj,0); newDataTable.Rows.Add(obj);}//newDataTable就是你要的了
//原本的兩個datatable1和datatable2DataTable DataTable1, DataTable2//兩個結構一樣的DT合併DataTable newDataTable = DataTable1.Clone();object[] obj = new object[newDataTable.Columns.Count];for (int i = 0; i < DataTable1.Rows.Count; i++){ DataTable1.Rows[i].ItemArray.CopyTo(obj,0); newDataTable.Rows.Add(obj);}for (int i = 0; i < DataTable2.Rows.Count; i++){ DataTable2.Rows[i].ItemArray.CopyTo(obj,0); newDataTable.Rows.Add(obj);}//newDataTable就是你要的了