This is giving me a headache. I have this link query here that grabs an ID
Dim mclassID = From x In db.SchoolClasses Where x.VisitDateID = _visitdateID Select x.ClassID
And then later on I have this linq query
ViewData("Staff") = From t In db.Staffs Where t.ClassID = mclassID Select t
Any help would be much appreciated. I’ve tried quite a few things but to no avail. I’ve attempted casting, converting, Is operand, etc.
The problem is that
myClassIDis an anonymousIQueryable. You need to force it into another type (Listis my favorite), and then pull it out of that type. So if you were to select it into aList(Of Integer)you could then extract theFirst()one since it would be the only. You could try something like this: