Expression of type <type> is not queryable

 

Updated: July 20, 2015

For the latest documentation on Visual Studio 2017 RC, see Visual Studio 2017 RC Documentation.

Expression of type <type> is not queryable. Make sure you are not missing an assembly reference and/or namespace import for the LINQ provider.

Queryable types are defined in the System.Linq, System.Data.Linq, and System.Xml.Linq namespaces. You must import one or more of these namespaces to perform LINQ queries.

The System.Linq namespace enables you to query objects such as collections and arrays by using LINQ.

The System.Data.Linq namespace enables you to query ADO.NET Datasets and SQL Server databases by using LINQ.

The System.Xml.Linq namespace enables you to query XML by using LINQ and to use XML features in Visual Basic.

Error ID: BC36593

To correct this error

  1. Add an Import statement for the System.Linq, System.Data.Linq, or System.Xml.Linq namespace to your code file. You can also import namespaces for your project by using the References page of the Project Designer (My Project).

  2. Ensure that the type that you have identified as the source of your query is a queryable type. That is, a type that implements IEnumerable<T> or IQueryable<T>.

System.Linq
System.Data.Linq
System.Xml.Linq
Introduction to LINQ in Visual Basic
LINQ
XML
References and the Imports Statement
Imports Statement (.NET Namespace and Type)
References Page, Project Designer (Visual Basic)

Show: