Retrive HEADERS from buid data table activity


I created a data table using buildDT activity like this
When i tried to print DataTable values, I am not getting the headers,

What should i do for getting headers

@krishna46111 can u post ur workflow here?

Where and how do you print headers? If you are writing this to an excel you can use option Add Headers


Or if you want column names you can do something like this

string temp2 = dt.Columns[i].ColumnName.ToString();

1 Like

What do you mean by print? If you’re using write range, then you should check Add Headers checkbox to see them. If you’re iterating through the datatable using a for each row, you can not see them.

Whith out using write CSV , I have to do some operations in between before WriteCSV activity

you can not print the headers of a datatable while in a for each row loop

also, just for you knowledge.
-You can use String.Join(",’,row.itemArray) to print the whole row.

-You can use dt.rows.indexof(row) while in a for each row loop to return the index of the row.