How do I transform a List into a DataSet?
You can do it through reflection and generics, inspecting the properties of the underlying type. Consider this extension method that I use: public static DataTable ToDataTable<T>(this IEnumerable<T> collection) { DataTable dt = new DataTable(“DataTable”); Type t = typeof(T); PropertyInfo[] pia = t.GetProperties(); //Inspect the properties and create the columns in the DataTable foreach (PropertyInfo pi … Read more