但對於1加入我得到錯誤當調用多個加盟我想加盟與多個條件的多個表的條件得到錯誤
聯接子句中的類型的表達式之一的不正確。在「加入」的調用中,類型推斷失敗。
from aq in auditUnitQuestions
join wt in questionWt on aq.AuditQuestionWtID equals wt.AuditQuestionWtID
join qt in auditQuestions on wt.AuditQuestionID equals qt.AuditQuestionID
join ac in AuditComponents on qt.ComponentID equals ac.ComponentID
join kra in AuditKRAs on new { ac.ComponentID, qt.KRAID } equals new { kra.ComponentID, kra.KRAID }
//below I am getting error (The type of one of the expressions in the join clause
//is incorrect. Type inference failed in the call to 'Join'.
join prm in auditParameters on new { kra.KRAID, qt.AuditParametersID } equals new { prm.AuditKRAID, prm.AuditingParametersID }
where aq.Unitcode == calendar.UnitCode
&& wt.AuditTypeID == auditType
&& qt.Isactive == "Y"
你有沒有試圖減少到最短的查詢失敗?例如,擺脫'aq','wt'和'ac'部分,因爲它們不是失敗連接的一部分......和where子句。 –