I try to do the following join :
var collection = from t1 in dt1.AsEnumerable()
join t2 in dt2.AsEnumerable()
on new {
t1.["main_code"],
t1["year"]}
equals new {
t2["dep_code"],
t2["dep_year"] }
select new {
emp_name = t1["name"],
bonus_desc = t1["bonus_desc"],
dep_name = t2["dep_name"] };
but I face the following build error!!
invalid anonymous type member declarator
Name properties of anonymous type of join :
var collection = from t1 in dt1.AsEnumerable()
join t2 in dt2.AsEnumerable()
on new { PropertyA= t1["main_code"], PropertyB=t1["year"]} equals new { PropertyA=t2["dep_code"], PropertyB=t2["dep_year"] }
select new { emp_name = t1["name"], bonus_desc = t1["bonus_desc"],dep_name = t2["dep_name"] };
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With