ASP.NET - Build a DataTable from scratch
Posted on 2009-04-22
I have some data that I would like to display in a gridview so I can take advantage of the formatting features that it offers. However, the data that I currently have from the database is not organized in a way that I would like to display it in the gridview. I want to reorganize it and prepare a new DataTable to bind to the gridview control.
What is the process that I would go through to create a new DataTable, define its column names, create the individual DataRows and start adding them to the DataTable?