Thursday, January 20, 2011

LINQ join two tables with condition

here is code

var result = from a in dbcontext.dbone
where a.state== "MD" && a.name == "Prashant"
join b in dbcontext.dbtwo
on select new {a.ID,a.DOB,a.GENDER}
equals select new {b.ID,b.DOB,b.GENDER}
select a;

No comments: