转换为linq sql查询错误

时间:2016-12-15 12:13:29

标签: sql sql-server

我有一个查询根据:

SELECT        
 tblDefinition.TopsisType, tblTemplate.tType, tblEvaluationFormCategory.Title AS EvaluationCategory,
            CASE tType WHEN 1 THEN N'2'
            ELSE N'1' END ProcessType,
              tblDefinition.Description, tblDefinition.TemplateID, 1 Destinition
 FROM            tblTemplate INNER JOIN
                     tblEvaluationFormCategory ON tblTemplate.CategoryID = tblEvaluationFormCategory.ID INNER JOIN
                     tblEFQMAlternative INNER JOIN
                     tblDefinition ON ([tblEFQMAlternative].[TopsisID] = [tblDefinition].[TopsisID] AND [tblEFQMAlternative].[CustomerID] = [tblDefinition].[CustomerID]) INNER JOIN
                     tblGroupMembers ON ([tblDefinition].[TopsisID] = [tblGroupMembers].[TopsisID] 
                     AND tblDefinition.CustomerID =
                      tblGroupMembers.CustomerID) ON tblTemplate.TemplateID = tblDefinition.TemplateID 
                       INNER JOIN
                     tblTerm ON tblDefinition.TermGrant = tblTerm.Title
    WHERE        (tblTerm.ID = 20) AND (tblGroupMembers.UserID = 558)
    GROUP BY tblDefinition.TopsisType, tblTemplate.tType, tblEvaluationFormCategory.Title,
        tblDefinition.Description, tblDefinition.TemplateID

当我转换为linq时,然后输入错误:

  Field [([tblDefinition].[TopsisID] = [tblGroupMembers]].[[TopsisID]    AND tblDefinition.CustomerID = tblGroupMembers.CustomerID) ON tblTemplate.TemplateID] not found in the current Data Context.

我该怎么办?

0 个答案:

没有答案