1teamsah
1teamsah

Reputation: 1933

Why can't I use LINQ in ASP.NET?

I'm working on an Asp.Net project.

I've .Net Framework 4.0 version.

When I want to use Linq in the project, I take this error message:

The type or namespace name 'Linq' does not exist in the namespace 'System.Data' (are you missing an assembly reference?)

What can I do to solve this problem?

Upvotes: 1

Views: 1632

Answers (2)

Narottam Makvana
Narottam Makvana

Reputation: 45

I hope that you fixed the problem, just in case you did not add this line into web config where other assembly's are

<add assembly="System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>

Upvotes: 1

Anik Islam Abhi
Anik Islam Abhi

Reputation: 25352

To use Linq you need to add

using System.Linq; 

if this line showing error then add this to your project reference.

System.Core.dll

Upvotes: 6

Related Questions