How to change the DataTable Column Name?
dtTempColumn.Columns["EXCELCOLUMNS"].ColumnName = "COLUMN_NAME";
dtTempColumn.AcceptChanges();
Rename the Column by doing the following:
dataTable.Columns["ColumnName"].ColumnName = "newColumnName";
Use:
dt.Columns["Name"].ColumnName = "xyz";
dt.AcceptChanges();
or
dt.Columns[0].ColumnName = "xyz";
dt.AcceptChanges();
Try this:
dataTable.Columns["Marks"].ColumnName = "SubjectMarks";