I have a main `DataTable` called `dtMain` and two child DataTables `dtSuccess` and `dtFail`. In a while loop that has a 10 second delay in each iteration some items in `dtMain` will be added to `dtSuccess` and `dtFail`.
So in each iteration I would like my `dtMain` to be clean from everything that is in those other two lists.

I will put the code I have tried here but unfortunately it does not work. 

```
while (dtMain.Rows.Count > 0)
{
   var query = dt.AsEnumerable().Except(dtSuccess.AsEnumerable(), DataRowComparer.Default)
                 .AsEnumerable().Except(dtFail.AsEnumerable(), DataRowComparer.Default);
   if (dtMain.AsEnumerable().Any())
        dtMain = query.CopyToDataTable();
   Thread.SLeep(10000);
}

```

I have received Exceptions such as:

> 
> Collection was modified; enumeration operation might not execute
> 
> 
> 

And `InvalidOperationException`

> 
> The source contains no DataRows
> 
> 
>