我從表中通過應用聯接兩個表中獲取數據,但我得到這個錯誤:錯誤連接子句中的一個表達式的類型不正確。類型推斷呼叫失敗「加入」
Error 40 The type of one of the expressions in the join clause is incorrect. Type inference failed in the call to 'Join'. C:\Documents and Settings\Ashir\My Documents\OpenLearningSolutions08-01-2013\OpenLearningSolutions\purchase.aspx.cs 70 21 C:\...\OpenLearningSolutions\
這裏是我的代碼:
OLSContainer ols = new OLSContainer();
var reSet = from l in ols.LEVEL_COURSE
join lp in ols.PACKAGES
on new { l.course_ID, l.levelID } equals new { lp.course_ID, lp.level_ID }
select l;
雖然所有的四列都是int nullabe類型的,但我得到這個錯誤。請幫助我。
什麼是第二個新表達式中的course_ID和levelID? –
這是從左側的成員名稱中加入表達 –
我解決我的問題,通過選擇數據形式的表是這樣的: –