Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > BOOK: Professional ASP.NET 4 : in C# and VB
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Display Modes
  #1 (permalink)  
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
Me.GridView1.DataBind()
End If
End Sub
  #2 (permalink)  
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.
Thanks
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 08: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 01:53 PM
Chapter 14 TIO #1406 Object That Provides a DataSe dcollins BOOK: Beginning ASP.NET 2.0 and Databases 0 October 23rd, 2006 02:35 PM



All times are GMT -4. The time now is 12:39 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.