1
我有以下代碼在提交行上拋出一個錯誤。它說那data type(s) of the type parameters) in method cannot be inferred from these arguments
。正如我(我認爲)明確說明數據類型肯定應該起作用。 userID
通過另一個查詢直接從數據庫中取出。類型參數的數據類型)在方法中不能從這些參數推斷
Dim compulsoryModule = (From mods In db.Modules
Join deg In db.Degrees On mods.Degree_code Equals deg.Degree_code
Where deg.Degree_code = degree And mods.Compulsory = True And mods.Level = 1
Select mods.Module_code)
Dim year = (From mods1 In db.Modules
Join deg1 In db.Degrees On mods1.Degree_code Equals deg1.Degree_code
Where deg1.Degree_code = degree And mods1.Compulsory = True And mods1.Level = 1
Select mods1.Year)
Dim semester = (From mods In db.Modules
Join deg In db.Degrees On mods.Degree_code Equals deg.Degree_code
Where deg.Degree_code = degree And mods.Compulsory = True And mods.Level = 1
Select mods.Semester)
Dim take As New Take With _
{.User_Number = userId, _
.Degree_code = degree, _
.Module_code = compulsoryModule, _
.Year = years, _
.Semester = semesters}
db.Takes.InsertAllOnSubmit(take)
它是給出了錯誤