Imports and references required to use LINQ

I have never used LINQ before, and I am getting an error in an application that does use it. This is a VB.NET (.NET 2.0) project in Visual Studio 2008.

Here is the offending code:

Dim orderedRows = From r In resultRows Order By r.FIELDNAME Select r

And here is the error (names changed to something generic, but otherwise accurate):

Expression of type '1-dimensional array of 
Company.OurLibrary.FunctionalArea.Library.StoredProcStuff.USP_MYPROC.ResultRow'
is not queryable. Make sure you are not missing an assembly
reference and/or namespace import for the LINQ provider.
C:\project\filename.vb

So I recognize that I need to import LINQ libraries. This link led me to add "Imports System.Linq" to the file, but that is an unresolved reference. Based on the same link, I figured I needed to add a reference to "System.Core" to my project, but it is not listed as an available option when I try to add a reference (nor is it already checked).

I feel sure I'm missing something basic. Can someone point me in the right direction?

TL;DR: What do I need for LINQ to work?

9
задан Ahmad Mageed 4 November 2010 в 13:57
поделиться