Below is LINQ query which returns the New records which exist in dtFreshdata but not in dtSnapShot.
My question is that
how to generalize this code so that it works for all DataTables of different schema
In this query I hard coded column name but I want to construct it dynamically.
and I have more than one Constraint column and i want Group join ON more than one constraints.
for e.g string strArrConstraints contains the constraints.
I hope You people come out with a solution ASAP.
Dim objquery = From FreshData In dtFreshData.AsEnumerable() _ Group Join SnapShotData In dtSnapShot.AsEnumerable() _ On FreshData("ACCTID") Equals SnapShotData("ACCTID") Into HaveMatch = Any() _ Where Not HaveMatch _ Select ACCTID = FreshData("ACCTID"), ACCTNAME = FreshData("ACCTNAME"), ACCTADDRESS = FreshData("ACCTADDRESS")