摘要: 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 阅读全文
posted @ 2011-06-02 23:20 复海大圣 阅读(354) 评论(0) 推荐(0) 编辑
摘要: 两个结构一样的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 阅读全文
posted @ 2011-06-02 23:17 复海大圣 阅读(335) 评论(0) 推荐(0) 编辑