I have the following code which is throwing an error on the submit line. It says that data type(s) of the type parameters ) in method cannot be inferred from these arguments
. As I have (I think) explicitly stated the data types surely it should work. The userID
is being taken directly from the database through another query.
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)
It is the last line that gives the error