How to Convert Generic List/Enumerable to DataTable

In this article I will describe, how to convert List/Enumerable objects to DataTable in C#. In the following code, I convert List of Object to DataTable. So I am created a method like below: public class MyExtention { public DataTable ConvertListObjectToDataTable<T>(IList<T> data) { PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(typeof(T)); DataTable table = … Continue reading