Wednesday, July 30, 2008

How to Create DataTable Programmatically in C#, ASP.NET ?

Most of the times programmers fill the DataTable from database. This action fills the schema of the database table into the DataTable. We can bind data controls like GridView, DropdownList to such DataTable. But somtimes what happens is one needs to create a DataTable programmatically. Here I have put the simple method of creating DataTable programmatically in C#.

Hi, i'm a newbie here. Is that possible if i want to store the data from the excel file into different datatable??

For example, there is 1 column that consists of 5 datarow in the excel file, i want to store them into different datatable.First data in datatable1, second data in datatable2, etc. So that later i can merge them into a gridview.