Building and Using a LINQ for SQL Class Library with ASP.NET 2.0
page 5 of 9
by Scott Guthrie
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 43163/ 76

Step 4: Creating a LINQ Enabled Web-Site that References our LINQ enabled Class Library

We will now want to go ahead and build a LINQ-enabled ASP.NET web-site that uses our LINQ class library.  Choose File->Add->Web Site within Visual Studio to add a new project to the solution.  Choose the LINQ web-site template to create an ASP.NET web-site that is enabled with the LINQ compilers.

Figure 7

Your VS solution will then look like this:

Figure 8

The last two steps you will want to take are to:

1) Add a project reference from the web-site project to the LINQ class library.  To-do this, right-click on the web-site and select "Add Reference," select the "Projects" tab and add the reference as normal.

2) Add a connection-string to your web.config file in the web-site project for the LINQ class library.  This will enable you to easily configure and change the connection-string that is used at runtime for the application.  Simply copy/paste the connection-string value in the LINQ class library's app.config file to the web.config file's <connectionString> section to configure this.

Once the above two steps are done, we are ready to build ASP.NET UI pages against our LINQ class library and associated data models.


View Entire Article

User Comments

Title: ras   
Name: rasd
Date: 2012-05-05 4:29:50 AM
Comment:
dfasd
Title: How to integrate with XLINQ in eixsting applications   
Name: Senthil
Date: 2008-12-17 12:20:06 AM
Comment:
How to integrate with XLINQ in eixsting applications?
Title: nice   
Name: john
Date: 2006-09-20 5:21:27 AM
Comment:
nice.. that give me a point






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


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-04-25 4:10:24 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search