标签:oar row static tac var oda 格式 pre ddr
//将list转成DataSet
public static DataSet ListToDataSet<T>(List<T> list) { if (list.Count == 0) return new DataSet(); var properties = list[0].GetType().GetProperties(); var cols = properties.Select(p => new DataColumn(p.Name)); var dt = new DataTable(); dt.Columns.AddRange(cols.ToArray()); list.ForEach(x => dt.Rows.Add(properties.Select(p => p.GetValue(x)).ToArray())); return new DataSet { Tables = { dt } }; }
标签:oar row static tac var oda 格式 pre ddr
原文地址:https://www.cnblogs.com/quwujin/p/12066908.html