#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2010
    Posts
    59
    Rep Power
    0

    Object not queryable


    Default.aspx.vb
    Code:
    Public Class _Default
        Inherits System.Web.UI.Page
        Dim author As Object
        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            Dim db As New PubsContext
            Dim authors = From p In dbo.authors _
                           Select p
    
            GridView1.DataSource = author
            GridView1.DataBind()
        End Sub
    End Class
    Class1.vb
    Code:
    Partial Public Class PubsContext
        Dim authors As Object
        Public Function GetProductsByCategory(ByVal id1 As Integer) As IEnumerable(Of authors)
            Return From p In Me.authors _
                   Where p.au_id = id1 _
                   Select p
        End Function
    End Class
    Error code on "authors": "Object not queryable. Make sure you are not missing an assembly reference and/or namespace import for LINQ."

    I have to add a reference to "System.Data.Linq" still didnot correct it. Any suggestions?
    Last edited by Philosophaie; July 17th, 2012 at 09:06 AM.

IMN logo majestic logo threadwatch logo seochat tools logo