vb.net - Operator '=' is not defined for types 'Integer' and 'IQueryable(Of Integer)' -


This is giving me a headache I have this link query that holds an ID

  Moderate mclassID = x to db.SchoolClasses where x.VisitDateID = _visitdateID select x.ClassID  

and then later I have this liner query

< P> ViewData ("Staff") = T to DB. Staffs where choose t.ClassID = mclassID

Any help would be greatly appreciated I have tried a lot, but I have not used any kind of casting, converting, ops Tried End etc.

The problem is that myClassID is an unknown IQueryable . You need to force it in any other type ( list my favorite), and then drag it out of that way So if you select it in the list (of integer), then you can remove before () , because it will be only one, you can try something like this: / P>

  Due to myClassIDList list (of integer) = new list (of integer) (_ to x db.SchoolClasses in where x.VisitDateID = _visitdateID select x.ClassID) as dim myClassID Integer = myClassIDList.First ()  

Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -