0

I have just begun working on a asp.net 4.5 (C#) webpage. I have just beginning to learn LINQ. To make sure I am doing everything right I pasted this code (from a Microsoft tutorial into a code file) :

int[] numbers = new int[7] { 0, 1, 2, 3, 4, 5, 6 };
        var numQuery =
            from num in numbers
            where (num % 2) == 0
            select num;

However everything is not right because it says System.LINQ does not exist and intelisense gives me this error when I hover over the keyword from : Feature 'query expression' cannot be used because it is not part of the ISO-2 language specification. I feel like I am missing a reference.

4
  • Did you try adding a reference ?using System.Data.Linq Commented Mar 4, 2014 at 2:04
  • what version of .NET Framework you are using? Commented Mar 4, 2014 at 2:04
  • this solution may help Commented Mar 4, 2014 at 2:04
  • I am using asp.net 4.5 and It says System.Data. LINQ does not exist. Commented Mar 4, 2014 at 2:07

1 Answer 1

1

Have a read through this

To enable basic LINQ functionality

  • In a Visual Basic or C# project, click the Project menu, and then click Add Reference.
  • In the Add Reference dialog box, click the .NET tab, scroll to System.Core.dll, and then click it. Click OK.
  • Add a using directive or Imports statement for System.Linq to your source code file or project.
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.