i have two datatable, dt1 and dt2. I want to remove all the row of dt2 from dt1.
eg.
dt1 has {apple, banana, cat}
dt2 has {apple, banana} here is my code. thanks
Dim rowsToDelete As New List(Of DataRow)()
For Each dr1 As DataRow In dt1.Rows
For Each dr2 As DataRow In dt2.Rows
If dr2("is_id").ToString() = dr1("is_id").ToString() Then
rowsToDelete.Add(dr2("is_id"))
End If
Next
Next
For Each dr As DataRow In rowsToDelete
dt2.Rows.Remove(dr)
Next
dt2.AcceptChanges()