摘要:
View Code 1 /// <summary> 2 /// 将集合类转换成DataTable 3 /// </summary> 4 /// <param name="list">集合</param> 5 /// <returns></returns> 6 public static DataTable ToDataTable(IList list) 7 { 8 DataTable result = new DataTable(); 9 if (list.Count > 0)10 {11 Pro 阅读全文
摘要:
两个结构一样的DataTable合并DataTable DataTable1 = new DataTable(); DataTable DataTable2 = new DataTable(); 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); newDa 阅读全文