Hello
I want to write left join by linq and fill a view by out but of this left join.
my left join is like below
select table1.a, table1.b,table2.c
from table1 left join table2
on table1.a=table2.c
where table2.g="123" or table2.g==null
as I said want to put output of this join to a view.
Thanks for your help.
Yadlapalli SrikanthPosted May 20, 2014, 6:59 AM
http://www.dotnet-tricks.com/Tutorial/linq/UXPF181012-SQL-Joins-with-C
Khan Abrar AhmedPosted May 20, 2014, 6:38 AM
http://msdn.microsoft.com/en-us/library/bb311040.aspx
Jignesh TrivediPosted May 20, 2014, 6:34 AM
try ...
var k = from t1 in db.table1
join t2 in db.table2 on new { a=t1.a } equals new {a=t2.c} into p
from l in p.DefaultIfEmpty()
where l.g == "123" || l.g ==null
select new {t1.a, t1.b,t2.c }
hope this will help you.