LINQ - inner join query in LINQ - Asked By ekta Garg on 08-Jun-12 05:16 AM

select FM.FacilityName,PB.FirstName,PB.LastName,PB.MiddleName,CW.StartDate,CW.CreatedBy,WC.Comments,CW.ID from tblCredentialWorkflowComments as WC inner join tblPhysicianBasic as PB on PB.ID = 26 inner join tblFacilityMaster as FM on FM.ID = 23 inner join tblCredentialWorkflow CW on CW.FacilityID = 23 and CW.PhysicianID = 26 where WC.WorkflowID = CW.ID

can anyone help me in writing this SQL query in LINQ with inner joins. ???

reply as asap...

thanks in advance
Chintan Vaghela replied to ekta Garg on 08-Jun-12 05:33 AM

Hi Frndz,

 

Functionality:  Inner join in LINQ

 

For LINQ inner join  using join key words

 

join tbl2 in ds.tblImages on tbl1.empid equals tbl2.id

 

 

 

 

 

Make LINQ  query::

 

 

var query = (from tbl1 in ds.tbl_empdetails

             join tbl2 in ds.tblImages on tbl1.empid equals tbl2.id

             where tbl1.empid.Value == 34

 

             select new { tbl1.empname, tbl2.imagename });

Hope this helpful!

Thanks