I have two data table and i want to return duplicate rows in second table if any duplicate found for same combination.
if does not match rows then it should return as below
the above example empno and sub1 from TAB1 should check in TAB2.
if both match then no need to worry.
if doesn't match the particular row (101 and A) then we should return rows from TAB2
below is my sample code.
but, it shows some error..
where is problem in my code...?
foreach (DataRow row in dt1.Rows)
EmpNo = row["EmpNo"].ToString();
Sub1 = row["Sub1"].ToString();
var duplicates = dt2.AsEnumerable()
.GroupBy(dr => row["EmpNo"].ToString() && row["Sub1"].ToString())
.Where(g => g.Count() > 1)
.Select(g => g.First())
pls. check my code...?