First row to be column in Datatable

Hi, I have extracted the datatable from the webpage. There is no columns for that datatable. I want the first row as a column.

Anyone suggest me a solution. If possible explain with workflow… Thanks in advance!!

@mkankatala

Use a for loop with dt.Columns and change type argument to datacolumn

Inside the loop use currentitem.ColumnName = dt.Rows(0)(currentitem.ColumnName).ToString

After the loop use assign to remove the first row as below dt = dt.AsEnumerable.Skip(1).CopyToDataTable

Or use remove data row activity

Hope this helps

Cheers

Hi @Anil_G

Thank you for your quick reply and elaborate answer. I have got the solution.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.