I have few methods that returns different Generic Lists.
Exists in .net any class static method or whatever to convert any list into a datatable? The only thing tha
To Convert Generic list into DataTable
using Newtonsoft.Json;
public DataTable GenericToDataTable(IList list) { var json = JsonConvert.SerializeObject(list); DataTable dt = (DataTable)JsonConvert.DeserializeObject(json, (typeof(DataTable))); return dt; }