26.2.12

Grab Datatables column Name in c#

Here is the code to grab the column name from the datatable and push it or recreate the same columns in another datatable.

foreach(DataColumn dc in objDatatable .Columns )
{

 dtNew.Columns.Add(dc.ColumnName;
}
 
 
Cheers,
Venkatesan Prabu .J
Head, kaaShiv InfoTech

No comments:

Post a Comment