Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hy pleas help me .
I cant convert this query in LINQ to SQL :

SQL
SELECT dbo.ReportType.Name FROM dbo.Center
INNER JOIN dbo.SwitchType ON dbo.Center.Switch = dbo.SwitchType.ID
RIGHT JOIN dbo.ReportType ON dbo.Center.ID = dbo.ReportType.ID
Posted

Hi,

Write your query like below.

var result = from a in dbo.Center
INNER JOIN switch dbo.SwitchType ON a.Switch = switch.ID
RIGHT JOIN report dbo.ReportType ON a.ID = report.ID

For more information please refer the below link.

Simple LINQ to SQL in C#[^]
 
Share this answer
 
v2
Hi,

you can try the following code. It might be help you.

C#
var ds = from p in dbo.Center
INNER JOIN dbo.SwitchType ON p.Switch equals SwitchType.ID
RIGHT JOIN dbo.ReportType ON p.ID equals ReportType.ID
SELECT NEW {Name}
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900