Hi Friend,
There are several way of creating and addinf columns to a table:
i typically use two techniques:
1. I create a columb object using datacolumn class then i add that to a columns collection
DataColumn dcCol1 = new DataColumn("Col1", typeof(int));
dt1.Columns.Add(dcCol1);
2. use the Add() of columns collection of the table to add a Column:
DataTable dt1 = new DataTable("Tale-1");
dt1.Columns.Add("col1", typeof(int));
which method is better in creating data columns?
thanks