I am trying to delete a row in a data table within a for each loop where one column of the row matches a criteria.
I am using DeleteRow from OpenRPA.Utilities, i have AddDataRow Working fine.
I cannot work out what i am supposed to put in the Row box to give the row i want to delete. It is asking for a type System.Data.DataRow I have the Index from the ForEach DataRow loop but that is an integer.
Can anyone suggest what to do other than get a script in Invoke Code to do the same job.
You give it the actual row (type DataRow). So, if you are using “foreach DataRow,” you just give it the actual row in the enumerator.
Edit: Sorry, got that wrong, ForEach DataRow is a dataview, so you get a DataRowView. But you can get it using row.Row
Beware this is slow if you have a large dataset or need to delete many rows (100+), then there are smarter and better ways.