How to change the DataTable Column Name? How to change the DataTable Column Name? asp.net asp.net

How to change the DataTable Column Name?


Try this:

dataTable.Columns["Marks"].ColumnName = "SubjectMarks";


Rename the Column by doing the following:

dataTable.Columns["ColumnName"].ColumnName = "newColumnName";


 dtTempColumn.Columns["EXCELCOLUMNS"].ColumnName = "COLUMN_NAME";                         dtTempColumn.AcceptChanges();