Wrox Programmer Forums
BOOK: Professional ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Professional ASP.NET 4 in C# and VB by Bill Evjen, Scott Hanselman, Devin Rader; ISBN: 9780470502204
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional ASP.NET 4 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old December 5th, 2010, 02:39 PM
Registered User
Join Date: Nov 2010
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
Default Chapter 9 Object not Queryable

Hi all,

I am getting this error message: Expression of type 'Object' is not queryable. Make sure you are not missing an assembly reference and/or namespace import for the LINQ provider.

I only get it on an existing project that I have. When I use another project with the exact syntax I don't get the error.

I have tried to look at the "add reference" and it seems like we are good to go there. Any suggestion are appreciated.

Here is the code, as outlined in the book. the "In movie" is generating the error.

Imports System.Collections.Generic
Imports System.Linq
Imports Microsoft.VisualBasic
Public Class FlashCards
Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

If Not IsPostBack Then

Dim movies = GetMovies()

Dim query = From m In movies _
Select m
Me.GridView1.DataSource = query
End If
End Sub
Old December 5th, 2010, 03:20 PM
Registered User
Join Date: Nov 2010
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
Default Fixed it

Option infer was turned off, I turn it on, now all is good.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 5:Access List with Server-side object Modle yueyao_xu BOOK: Beginning SharePoint 2010 Development 8 November 11th, 2010 05:02 PM
Chapter 7 Object reference error in master.cs mikeal_a BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 4 September 5th, 2008 07:19 AM
chapter about object datasource and gridview? asptwodev BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 1 November 2nd, 2007 12:53 PM
Chapter 14 TIO #1406 Object That Provides a DataSe dcollins BOOK: Beginning ASP.NET 2.0 and Databases 0 October 23rd, 2006 01:35 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.