摘要:
/// <summary> /// 将集合类转换成DataTable /// </summary> /// <param name="list">集合</param> /// <returns></returns> public static DataTable ToDataTable(IList list) { DataTable result = new DataTable(); if (list.Count > 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) { ... 阅读全文