c# - Make a SQL Query to LINQ -


this question exact duplicate of:

how sql query linq?

  select customer.name   company inner join customer on company.companyid = customer.companyid   companyid = 2 

you try one:

var result = c in companies              join cu in customers              on c.companyid equals cu.companyid              c.companyid==2              select cu.name 

or

var result = db.companies                .join(customers.where(x==>x.companyid==2),                       x=>x.companyid,                       y=>y.companyid,                       y=>y.name); 

where companies , customers refer companies , customers respectively.


Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -