I stuck to find duplicates from 2 datatables where the condition is dynamic.
Let's say TABLEA and TABLEB has same schema
and comparison columns could be anything. Columns could be more than one.
how can i build a dynamic condition to remove duplicate from TABLEA.
here i tried this query
e.g. i have column name with comma seperated
dynamiccolumnA, dynamiccolumnB, dynamiccolumnC
var matched = from table1 in dt1.AsEnumerable()
join table2 in dt2.AsEnumerable() on
table1.Field<object>(dynamiccolumn) equals table2.Field<object>(dynamiccolumn)
where table1.Field<object>(dynamiccolumn) != table2.Field<object>(dynamiccolumn)
select table1;
" where table1.Field(dynamiccolumn) != table2.Field(dynamiccolumn)" this statment could be for more than one column.
Could anybody gives me some pointer regarding this.
Thanks in advance