This can be done quickly and easily with a simple ‘for each’ loop. I will assume your datatable is a variable called dt1
Use a for each activity and change the TypeArgument to System.Data.DataColumn For each col in dt1.Columns Assign col.ColumnName = dt1.rows(1).item(col).ToString
You beat me to it
I did exactly the same as you and came here to post. no point now.
The only thing that confused me is using the UseColumnHeader option, to me it seems logical to use the UseRowHeader option but it was erroring for me so tried Column header and it worked.
Thank you for you reply. I actually checked behavior of UseRowHeader and UseColumnheader.
I confirmed UseColumnHeader is correct in this case. (Sorry for confusion.)
However, I cannot reproduce any error in UseRowHeader. Can you share your data?
If we check UseRowHeader option, the activity considers the first column as a header and delete it.
So if table string has 2 columns, result table has just a column because the above specification.
This is why your error occurred.
That makes sense that it is deleting it - thank you now I understand why it was erroring. Just logically in terms of the English language I would have thought UseRowHeader would mean use the row as the header. Anyway Nikhil is sorted now. and thanks for the explanation that the column was being deleted.