Start writing values at a certain row and the values are in an IEnumerable

Hi everyone. So, I would like to start writing values starting from let’s say the 4th row of a datatable. in addition to that, I read a column from an excel sheet and would like to use that to populate the datatable.

So far I tried a for each row in datatable followed by a for each item in the Inenumerable [the column result’s data type]. I tried making it into an array. That did not work out because when I assigned it to for row(4).items(“Column Name”), it put everything in that one cell.

Please let me know. thank you!

1 Like

It doesn’t work with For Each Row loop because for each row starts from very first row, either you put some condition so that it skips those rows or try other approach like while loop:
counter=3
while counter<DT.rows.count
DT.Rows(counter).item(“Column Name”)=“Value you want to write”
counter=counter+1

Hope you got the Idea…!!!

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