Answer: To create a column in the DataTable we can use the Columns.Add method of the DataTable object and pass DataColumn object as parameter.
DataTable dTable = new DataTable();
// create another column
DataColumn name = new DataColumn("Name", typeof(string));
dTable.Columns.Add(name);
Asked In: Many Interviews |
Alert Moderator