I would like to retain the datatable(dt2) but delete the contents of it. Actually am using for loop to enter data into this table. Once the data is transferred to excel, I would like to delete all the rows in datatable but retain an empty datatable so that I can enter new set of data again. This process is like a loop
Enter data in dt2—> Delete data in dt2—>Enter data in dt2—>Delete data in dt2…goes on like this
I encountered an error when I tried to use Remove Data Row, as I can’t iterate within the same table(dt2) while removing the rows.
Is there any command like dt2 = dt2.clear
Any help would be appreciated