Wednesday, March 6, 2013

Convert object into DataTable C#

Recently I got a requirement in a project to convert own type of object to DataTable. Here I am sharing my code with you.

Steps

1. Create datatable and give a name
2. Create Column Names
3. Create a Data Row
4. Add Data in to DataRow
5. Add DataRow to DataTable
Thats it...
Here some Extended Method to how to use this method
https://github.com/cbjpdev/DataTableX