Remove lines from datatable until its empty

Hey everyone,

I have datatable which the number of rows change, I need to write the data on the table but i can only process 15 lines in at once so i will have to write first 15 lines than the other 15 untill there is nothing left.



Use a Do-While loop and also declare a Int32 variable

Inside that you can use Assign activity and write as below to take 15 lines

Datatable15Lines = Datatable.AsEnumerable.Take(15 * Int32Variable).CopyToDatatable

Now use another Assign activity to skip the 15 lines

DatatableNext15Lines = Datatable.AsEnumerable.Skip(15 * Int32Variable).CopyToDatatable

Increment the Int32 Variable by using Assign → Int32Variable = Int32Variable+ 1

Hope this will help you


Okay, but what will be the condition of do while? Like I said i dont know the row size it may change from time to time the condition should be that the datatable is empty, so how can i write it

Have a look here:


You can use Assign activity and write as below

IntDivideVariable = dt.Rows.Count / 15

Now write as IntDivideVariable <> Int32Variable

Hope this will help you