Expression of type 'Object' is not queryable. Make sure you are not missing an a
下面的代码红色部分报错:Expression of type 'Object' is not queryable. Make sure you are not missing an assembly reference and/or namespace import for the LINQ provider
已经引入了
Imports System.Linq
Imports System.Data.Linq
Dim db As RAWSDataClassesDataContext = New RAWSDataClassesDataContext()
Dim q = From item In db.TaskMasters
Where item.taskId = 2
Select item
Dim q1 = From item In q
Where item.Leid = 21
Select item
网上查不到方案。 linq .net linq to sql issue --------------------编程问答--------------------
Dim q As IQueryable(Of TaskMaster) = From item In db.TaskMasters.AsQueryable()
Where item.taskId = 2
Select item
you must also turn Option Infer on (in Visual Basic only) --------------------编程问答--------------------
It works. Thank you :)
But I encountered a strange thing: the same code(my original code) works well in another project which I created to test this issue, and it doesn't work in my current project.
@q107770540, Do you know why?
补充:.NET技术 , LINQ