I have a dataTable dt_Sample, and there are rows I need to remove from here. I used activity: Remove Data Row inside if statement but it returned an error “Collection was modified. Enumeration operation may not execute”.
It seems like I have to use Select function, but I don’t know if I can do that in my situation. There are multiple conditions I need to consider when removing the rows from the datatable. All data are in string. The column name is “SampleString”
- The data ends with “-123”, AND 2) The length of the string is 9
- The data ends with “-456”. AND 2) The length of the string is 14
In either case, the row needs to be removed from the table. Using if statement on this is easy, but I am not sure I can do this with Select function. Column name is specified, but I have to check if the data ends/starts with a certain value, and I also have to check the length of the string.
How would you go about this?