How to create a column in the DataTable?

 Posted by Raja on 6/7/2009 | Category: ADO.NET Interview questions | Views: 4004

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));

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response