Al Programming
Free source code programming in C#, VB.Net, Java, SQL
Search This Blog
Friday, November 8, 2013
Add Columns to DataTable C#
C#
>
DataTable
>
Add column
Using Columns collection we can add columns to DataTable in runtime.
Example:
DataTable
dt =
new
DataTable
(
"Product"
);
dt.Columns.Add(
"id"
,
typeof
(
Int32
));
dt.Columns.Add(
"name"
,
typeof
(
string
));
Newer Post
Older Post
Home