送信行でエラーをスローしている次のコードがあります。それは言う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)
エラーが発生するのは最後の行です