c# - Multiple table join with multiple table where clause -
i have query that's this.
select a.* table1 inner join table2 b on a.field1 = b.field1 inner join table3 c on b.field2 = c.field2 b.field4 = beta , c.field5 = gamma.
on linq, tried way:
var query = (from in table1 join b in table2 on a["field1"] equals b["field1"] join c in table3 on b["field2"] equals c["field2"] (b["field4"] == beta && c["field5"] == gamma) select a).tolist();
but reason, when try error says entity "table2" doesn't have field name = "field5", though clause last joined table , other ones unaccessible. furthermore, compiler doesn't seem notice neither, because lets me write c["field5"] == gamma no warning.
any ideas? writing wrong?
thanks
see these links:
how to: perform inner joins (c# programming guide)
what syntax inner join in linq sql?
why don't create view in database, , select data view in linq?
Comments
Post a Comment