Problem with Remove Data Table activity

Hi, I’m trying to use Remove data table activity, but when trying to delete row from data table tabelaFilter I’am getting below error (I have to delete all rows from tabelaFilter that exist in table tabelaZaBrisanje). I printed all data from tabelaZaBrisanje before removing, and conclusion is it is properly presented.

Does anyone have idea what the problem could be?

You cannot delete a row when you do loop using For Each on it.

Hi @Olivera_Kalinic ,

If you are trying to empty a DataTable, you could try this:
Assign->

tabelaZaBrisanje = tabelaZaBrisanje.Clone()

If you wish to do so conditionally, we can use a Where Clause instead.
If you provide the condition, I can come up with something for you.

Kind Regards,
Ashwin A.K

The condition is simple - I have to delete all rows from tabelaFilter that exist in table tabelaZaBrisanje

Hi @Olivera_Kalinic ,

If the columns in both are same, then could you give this a try?

tabelaFilter.AsEnumerable.Except(tabelaZaBrisanje.AsEnumerable(),DataRowComparer.Default).CopyToDatatable()

Kind Regards,
Ashwin A.K

Thanks a lot, it works :slight_smile:

1 Like

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