Reputation: 89
I have Three Table without assosiatated as Follows
Some clients they don't Have bank Details so I need to get all the Cleint Info Who has the bank and Who hasn't the bank, and same as country info
I know It's "left outer join" method. how its in the Linq to sql
vb.net code Please
Upvotes: 4
Views: 2691
Reputation: 176896
var query =
from order in dc.Orders
from vendor
in dc.Vendors
.Where(v => v.Id == order.VendorId)
.DefaultIfEmpty()
from status
in dc.Status
.Where(s => s.Id == order.StatusId)
.DefaultIfEmpty()
select new { Order = order, Vendor = vendor, Status = status }
//Vendor and Status properties will be null if the left join is null
LEFT OUTER JOIN in LINQ To SQL
Upvotes: 4