Click here to Skip to main content
14,239,168 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hy pleas help me . I cant convert this query to LINQ

SELECT  dbo.ReportType.name FROM  dbo.Center
INNER JOIN  dbo.SwitchType ON dbo.Center.SwitchTypeID = dbo.SwitchType.SwitchTypeID
RIGHT  JOIN   dbo.ReportType ON dbo.SwitchType.SwitchTypeID = dbo.ReportType.SwitchTypeID
WHERE     (dbo.Center.CenterID = 1) OR (dbo.ReportType.SwitchTypeID IS NULL)
Posted

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

just an assumption, but try splitting it up

var res1 = from t1 in center
join t2 in switchtype on t1.switchtypeid = t2.switchtypeid on j1
from j on j1
join t3 in reporttype on j1.t2.switchtypeid = t3.switchtypeid
where j1.t1.centerid == 1 || j1.t1.sitchtypeid == null
select new { reportname = t3.name
}
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100