Introducing LINQ—Installing LINQ

Jump to: navigation, search
Visual C# Tutorials
Database Tutorials

Introducing LINQ

© 2006 J. Huddleston, et al

Installing LINQ

Installing LINQ doesn’t replace any .NET 2.0 assemblies, but it does change our VCSE development environment, adding some new project types that support LINQ and use the C# 3.0 compiler (as you’ll see later in Figure 18-7).

The May 2006 LINQ CTP (Community Technology Preview) can be downloaded from the LINQ Project home page, http://msdn.microsoft.com/data/ref/linq/. Go there and click Microsoft Visual Studio Code Name "Orcas" - LINQ CTP (May 2006), which will take you to the download page. It’s small enough to just run the download if you have a reasonably fast Internet connection, but we save it to c:\bcs2005db\install.

To install LINQ:

1. Run LINQ Preview (May 2006).msi, which starts the LINQ installation process. When the Welcome window appears (see Figure 18-1), click Next.
2. When the License Agreement window appears (see Figure 18-2), click the I Agree radio button and when the Next button is enabled, click it.


Image:777xf1801.jpg
Figure 18-1. LINQ installation Welcome window


Image:777xf1802.jpg
Figure 18-2. LINQ License Agreement window


3. When the Update C# Language Service for LINQ window appears (see Figure 18-3), click the Update C# Language Service radio button and click Next.
4. When the Confirm Installation window appears (see Figure 18-4), click Next.
5. A progress window appears (see Figure 18-5). When the Next button is enabled, click it.


Image:777xf1803.jpg
Figure 18-3. Update C# Language Service for LINQ window


Image:777xf1804.jpg
Figure 18-4. LINQ Confirm Installation window


6. When the Installation Complete window appears (see Figure 18-6), click Close. LINQ is now installed, and you’ll find a lot of useful things in C:\Program Files\LINQ Preview. (We recommend you look at ReadMe for C#.htm.)


Image:777xf1805.jpg
Figure 18-5. LINQ insallation progress window


Image:777xf1806.jpg
Figure 18-6. LINQ Installation Complete window


7. Open VCSE and create a new project. You should see the four new templates for LINQ shown in Figure 18-7. Select LINQ Console Application, change the project name to Chapter18, and click OK.


Image:777xf1807.jpg
Figure 18-7. VCSE New Project window with LINQ templates


8. A message box will alert you to your use of an unsupported version of C# 3.0 (see Figure 18-8). Don’t worry, it works well enough for this chapter (in fact, it works quite stably). Click OK.


Image:777xf1808.jpg
Figure 18-8. Unsupported version of C# 3.0 message box


9. In Solution Explorer, expand the References node. Note the four new assemblies (System.Data.DLinq, System.Data.Extensions, System.Query, and System.Xml.XLinq) VCSE automatically provides (see Figure 18-9).
10. Double-click Program.cs. Note the three new namespaces (System.Query, System.Xml.XLinq, and System.Data.DLinq) VCSE automatically provides using directives for (see Figure 18-10). Save the solution. We’re ready to do some LINQ database programming.


Image:777xf1809.jpg
Figure 18-9. LINQ references


prevpp.png  nextpp.png
C# Online.NET