Is there someone help me convert it into LINQ?
SELECT DISTINCT TBCAR1.MAKE_ID, TBCAR1.Species, TBCAR1.ModelName, TBCAR1.ModelNum, TBCAR1.Body, TBCAR1.ModelFrom, TBCAR1.ModelTo, TBCAR1.Doors,TBCAR1.VersionName, TBCAR1.CodeList, TBCAR1.BodyName, TBCAR1.ModelYear, TBCAR1.Fuel, TBCAR1.Kw, TBCAR1.Cyli, TBCAR1.contOE,TBCAR1.Body_ID, TBCAR1.TYPE_ID, TBCAR1.vehicleFileName, MIN(TBCAR3.ClearEngine) AS CodMotore, ISNULL(TBCAR1.codeType, TBCAR1.codeRange) AS CodVersione, TBCAR1.ccmTech, TBCAR1.nOE, TBCAR1.Engine, TBCAR1.codeType, TBCAR1.Volume, LEFT(TBCAR1.Build_From, 4) AS AnnoDal,RIGHT(TBCAR1.Build_From, 2) AS MeseDal, LEFT(TBCAR1.Build_To, 4) AS AnnoAl, RIGHT(TBCAR1.Build_To, 2) AS MeseAl,TBCAR3.ClearEngine
FROM TBCAR1 LEFT OUTER JOIN TBCAR2 ON TBCAR1.TYPE_ID = TBCAR2.TypeID AND TBCAR1.Body_ID = TBCAR2.BodyID LEFT OUTER JOIN TBCAR3 INNER JOIN TBCAR4 ON TBCAR3.CTYPE_ID = TBCAR4.ComponentTypeID ON TBCAR1.TYPE_ID = TBCAR4.TypeID
GROUP BY TBCAR1.Build_From, TBCAR1.Build_To, TBCAR1.MAKE_ID, TBCAR1.Species, TBCAR1.ModelName, TBCAR1.ModelNum, TBCAR1.Body,TBCAR1.ModelFrom, TBCAR1.ModelTo, TBCAR1.Doors, TBCAR1.VersionName, TBCAR1.CodeList, TBCAR1.BodyName, TBCAR1.ModelYear,TBCAR1.Fuel, TBCAR1.Kw, TBCAR1.Cyli, TBCAR1.contOE, TBCAR1.Body_ID, TBCAR1.TYPE_ID, TBCAR1.vehicleFileName, TBCAR1.ccmTech,TBCAR1.nOE, TBCAR1.Engine, ISNULL(TBCAR1.codeType,TBCAR1.codeRange), TBCAR1.codeType, TBCAR1.Volume, TBCAR3.ClearEngine
HAVING (TBCAR1.MAKE_ID = 3) AND (TBCAR1.ModelNum = '8PA') AND (TBCAR1.ModelName = 'A3') AND (TBCAR1.Body = 'BER') AND (TBCAR1.Doors = 5) AND (TBCAR1.BodyName = 'Sportback') AND (TBCAR1. Species = 'CAR')
ORDER BY TBCAR1.ccmTech, TBCAR1.Kw
Or is there an alternative without converting SQL but using datacontext objects?
Thanks
Cris