标签:
public static List ToList(DataTable dt) { List<Dictionary<string, object>> list = new List<Dictionary<string, object>>(); foreach (DataRow dr in dt.Rows) { Dictionary<string, object> result = new Dictionary<string, object>(); foreach (DataColumn dc in dt.Columns) { result.Add(dc.ColumnName, dr[dc]); } list.Add(result); } return list; }
标签:
原文地址:http://www.cnblogs.com/CielWater/p/4741293.html