Using LINQ with ASP.NET (Part 1)
page 2 of 12
by Scott Guthrie
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 21589/ 509

Step 0: Creating a C# LINQ ASP.NET Web Site

To create a new ASP.NET Web Site that can use LINQ/DLINQ/XLINQ and the new C# 3.0 language features, choose File->New Web Site in VS and select the “LINQ ASP.NET Web Site Template”:

Figure 1

 
<img border=0 width=662 height=437src="/ArticleFiles/922/image001.jpg">

This will create a web-site project with the following files in-it by default:

Figure 2

<img border=0 width=246 height=260src="/ArticleFiles/922/image002.jpg">

Note that it includes a number of LINQ assemblies in the \bin folder.  It also adds the following setting to the app’s web.config file which tells both VS and ASP.NET to use the C# 3.0 compiler to compile and run the app:

Listing 1

<system.codedom>
  <compilers>
   <compiler language="c#;cs;csharp" 
extension=".cs"  type="Microsoft.CSharp.CSharp3CodeProvider,CSharp3CodeDomProvider"/>
  </compilers>
</system.codedom>

Note that the C# 3.0 compiler and CodeDOM provider can run side-by-side with the C# 2.0 versions (so you don’t have to worry about it breaking VS or ASP.NET when you install it). 


View Entire Article

Article Feedback

Title:  
Name:  
Url: ( Optional )
Comment:  
Please add 3 and 1 and type the answer here:

User Comments

Title: Trying To Get a Handle On This LINQ Stuff   
Name: D Wiley
Date: 11/21/2008 9:21:36 AM
Comment:
This is on of the best walkthroughs I have seen on the subject.
Title: Leraning LINQ   
Name: Manjeev kumar singh
Date: 10/3/2008 4:00:41 AM
Comment:
This one is most useful article LINQ on web. its really good start for how is beginner in LINQ....
Really thanks
Title: Using Richer Collections   
Name: Nithya K
Date: 9/18/2008 6:58:04 AM
Comment:
Now i got .Its my mistake.
It is very useful
Title: Using Richer Collections   
Name: Nithya K
Date: 9/18/2008 6:00:18 AM
Comment:
i got an error while executing
Title: Using Richer Collections   
Name: Nithya K
Date: 9/18/2008 5:53:19 AM
Comment:
\
\S
\
\
Title: Leraning LINQ   
Name: vanitha
Date: 9/16/2008 1:31:46 AM
Comment:
Very useful in learning the basic concepts of LINQ.
Title: Using LINQ with ASP.NET   
Name: Durai karthik M
Date: 3/15/2008 7:20:50 AM
Comment:
Very clear to understand the LINQ concept . Keep up the good work
Title: -   
Name: martin
Date: 1/21/2008 4:41:46 AM
Comment:
The images aren't shown... you need to remake the picture HTML

Product Spotlight
Product Spotlight 
Learn More
.NET Tools
asp.net shopping cart
asp.net chart control






Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2008 ASPAlliance.com  |  Page Processed at 12/3/2008 2:41:54 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search