我很新的實體框架,我試圖在兩個實體上使用連接子句,如下所示。LinQ錯誤LINQ聯合類型推斷未能調用'聯接'錯誤
var alertlist = from elogAlert in yangkeeDBEntity.Yang_Kee_Logistics_Pte_Ltd_ELog_Tablet_Alert
where elogAlert.No_ != null
join elogAlertDetail in yangkeeDBEntity. Yang_Kee_Logistics_Pte_Ltd_ELog_Tablet_Alert_Details
on elogAlert.No_ == elogAlertDetail.AlertID
where elogalertdetail.employee_id == driverid
select new
{
elogalertdetail.employee_id,
elogalertdetail.alert_id,
elogalertdetail.no_,
elogalertdetail.status,
elogalertdetail.created_by,
elogalertdetail.date_created,
};
喜從上面的代碼我得到兩個錯誤說
'Error 1 The name 'elogAlertDetail' is not in scope on the left side of 'equals'. Consider swapping the expressions on either side of 'equals'.' and 'linq joint type inference failed to call 'join' error '
目前這兩個表不具有任何數據。如果有人能夠幫助我解決這種情況,我會很高興
AlertID和No_是否可能是兩種不同的數據類型? – 2013-04-18 05:57:25
數據類型相同:)謝謝 – Kalanamith 2013-04-18 06:03:56
您非常歡迎先生。 – 2013-04-18 06:15:05