I have a datatable type variable that looks like this when written in an Excel:
I’d like to do some data table manipulation where row 3 will be the header. However, since there is a duplicate column name, I’m having a hard time figuring it out. I plan to assign new value to column B Class before removing the first two rows and converting the 3rd row as new header. Two of my problems are:
How can I chance the value of the first Class column name?
How to convert the third row as the datatable header?
If row 3 and the column location is fixed the use assign with dt.Rows(2)(1) = "NewName"
Then use for loop with dt.Columns and inside use assign with currentitem.ColumnName = dt.Rows(2)(index).ToString index is a variable to be created from for loop properties index
Now use dt = dt.AsEnumerable.Skip(3).CopyToDatatable