摘要: /// <summary> /// 将集合类转换成DataTable /// </summary> /// <param name="list">集合</param> /// <returns></returns> public static DataTable ToDataTable(IList list) { DataTable result = new DataTable(); if (list.Count > 0) { ... 阅读全文
posted @ 2012-07-18 20:28 jeffrey77 阅读(163) 评论(0) 推荐(0)
摘要: public IList<T> DataTableToList<T>(DataTable dataTable) { List<T> list = new List<T>(); Type targetType = typeof(T); PropertyInfo[] allPropertyArray = targetType.GetProperties(); foreach (DataRow rowElement in dataTable.Rows) { ... 阅读全文
posted @ 2012-07-18 20:22 jeffrey77 阅读(140) 评论(0) 推荐(0)