RedsDevils
RedsDevils

Reputation: 1433

What do I need to reference here?

I write this piece of code with C# using ADO.NET Entity Framework.

I found error in here

var departmentQuery = from d in schoolContext.Departments.Include("courses")
                              orderby d.Name // here
                              select d;

Error message is like the following:

Cannot convert lambda expression to type 'string' because it is not a delegate type 

I am doing according this articles

http://msdn.microsoft.com/en-us/library/bb386884.aspx

please point out what do i need to modify?

Thanks in advance!

Best regards, RedsDevils

Upvotes: 0

Views: 82

Answers (2)

Lunivore
Lunivore

Reputation: 17602

The only difference I can see between your code and the example is that you have a small "c" in "courses".

Upvotes: 1

Bhaskar
Bhaskar

Reputation: 10681

Make sure you have the using System.Linq in the code. Add a reference for this in project if you are unable to find it in your intellicence.

Upvotes: 2

Related Questions