How can i create Left join query in Linq to sql

Posted by Sampath1750 under ASP.NET on 4/13/2012 | Points: 10 | Views : 1681 | Status : [Member] | Replies : 2
I want Left join query using LInq to sql.
How can i convert below query into left joins query.

from customer_access in Adm.customer_accesses
join c in Adm.customers on customer_access.customer_no equals c.customer_no
join ur in Adm.user_roles on customer_access.user_id equals ur.user_id
join ar in Adm.app_roles on ur.role_id equals ar.role_id
select customer_access;

sql query is:
select * from customer_access ca left join customer c on ca.customer_no = c.customer_no left join user_roles ur on ca.user_id = ur.user_id left join app_roles ar on ur.role_id = ar.role_id

Thanks




Responses

Posted by: Rajni.Shekhar on: 4/13/2012 [Member] Bronze | Points: 25

Up
0
Down
check below site

http://social.msdn.microsoft.com/Forums/en-US/linqtosql/thread/ec21d2d9-6f02-4577-af4d-eed5e07fbaf1

Thanks,
Rajni Shekhar

Sampath1750, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ajay.Kalol on: 4/14/2012 [Member] Starter | Points: 25

Up
0
Down
http://ajaypatelfromsanthal.blog.com/2012/03/15/joins-in-linq/

Here is example of joins in Linq,

Enjoy...

Ajay
ajaypatelfromsanthal.blogspot.in

Sampath1750, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response