Help with Where Clause in LinqPad

edited June 2012
Hi buddies,
I am new to LINQPad. I am using LINQ to Entities and LINQ to oData but have problems whenever I try to use a where clause:
from s in Students
where s.StudentId == 34
select s
I get the error:
'LINQPad.User.Student' does not contain a definition for 'StudentId' and no extension method 'StudentId' accepting a first argument of type 'LINQPad.User.Student' could be found (press F4 to add a using directive or assembly reference)
Please help me.


  • Options
    I notice that is I use a where clause with a different column e.g.
    from s in Students
    where s.LastName == "Osmumos"
    select s
    it works perfectly.

    But whenever I try to use a Primary Key or Foreign Key column in the where clause, it fails terribly. I wonder whether there is some configuration i need to do.

  • Options
    Sorry guys, I have just realized it was my mistake. It was wrong spelling: I was using StudentId instead of StudentID.

  • Options
    When you purchase autocomplete, you won't have this kind of issue :p
    (Joel, want to give me some commision?)
Sign In or Register to comment.