Hi @HOUSSEM MAHJOUBI ,
As far as I think,you could replace for with for each.Just like this:
Dim rowsToDelete As List(Of DataRow) = New List(Of DataRow)()
For Each dr10 As DataRow In tab10.Rows
For Each dr As DataRow In tab.Rows
If dr10.Item(2) = dr.Item(2) Then
rowsToDelete.Add(dr10)
End If
Next
Next
For Each r In rowsToDelete
tab10.Rows.Remove(r)
Next
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Best regards,
Yijing Sun