views:

36

answers:

2

I have Three Table without assosiatated as Follows

  1. Clients
  2. Bank
  3. Country

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

+1  A: 

If you know your SQL query, create your left join and execute it through LinqPad.

It can then output the corresponding LINQ query.

Best of luck.

GONeale
is it possible to convert SQL query in to Linq using above LinqPAD
Suhaibnm
+1  A: 
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

Pranay Rana