Linq on visual studio 2005

2019-02-19 00:36发布

问题:

i was wondering how to install linq on visual studio 2005 without upgrade the .net framewok version , Thanks

回答1:

LINQ is part of C#3.0. It is not available in C#2.0 which is the only version VS 2005 supports. So you won't be able to use LINQ without installing at least VS 2008.



回答2:

You don't.

"Language-Integrated Query (LINQ) is a set of features in Visual Studio 2008 that extends powerful query capabilities to the language syntax of C# and Visual Basic. LINQ introduces standard, easily-learned patterns for querying and updating data, and the technology can be extended to support potentially any kind of data store. Visual Studio 2008 includes LINQ provider assemblies that enable the use of LINQ with .NET Framework collections, SQL Server databases, ADO.NET Datasets, and XML documents."
Source - Microsoft



回答3:

Unless I'm mistaken, Visual Studio 2005 supports up to .Net 3.0, whereas LINQ requires 3.5, so therefore it can't be done.



回答4:

As commented, it's part of the C#3.0 so VS2005 doesn't really support it.

If you look LINQ in VS2005 there is a method of getting it to work, but it doesn't support anonymous types taking away some of the power of LINQ.