I need to REMOVE the matched rows with “UID” and “INV_NO” columns of dt_First to “UID” and “INV_NO” columns of dt_Second. The matched rows will be removed on dt_First.
As you can see there are two rows with “234B” UID and “234B” INV_NO on dt_First but there is only one match on dt_Second. Only one row(or depends how many matches on dt_Second) with “234B” UID and “234B” INV_NO on dt_First will be removed.
This is the EXPECTED new dt_First.
Any kind of help would be appreciated. Thank you in advance!
There is a LINQ made by sir @ppr but it is only made to match one column.
(From d1 In dt_First.AsEnumerable
Group d1 By k=d1("UID").toString.Trim Into grp=Group
Let mcc = dt_Second.AsEnumerable.Where(Function (d2) d2("UID").toString.Trim.Equals(k)).Count
Where Not (grp.Count = 1 And mcc > 0)
Where Not (grp.Count > 1 And mcc > 1)
Let skipper = Convert.ToInt32(grp.Count > 1 And mcc = 1)
From g In grp.Skip(skipper)
Order By dt_First.Rows.IndexOf(g)
Select r=g).CopyToDataTable
Is this possible to revise with multiple columns between the two data tables? If yes, what should be changed on the syntax?