.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Articles >> LINQ >> Post New Resource Bookmark and Share   

 Subscribe to Articles

LINQ with IIS sites and ASP.Net Web Applications

Posted By:Dhananjay Kumar       Posted Date: August 09, 2010    Points: 25    Category: LINQ    URL: http://www.dotnetspark.com  

In this article, we will see how to work with LINQ against IIS. Before applying LINQ against IIS sites and application pool, we need to set up the environment
 

Objective 


In this article, we will see how to work with LINQ against IIS.


Before applying LINQ against IIS sites and application pool, we need to set up the environment. Follow the bellows steps to do this.

You can also follow my Blog


Step 1


Download  Microsoft.Web.Administration.dll and save to a particular directory. I am saving it in D drive of local storage. 


Step 2


Create a new console project and add Microsoft.Web.Administration dll as service reference. To add a reference right click on the project and click add service reference. Then browse to the directory where, we have saved the downloaded dll of the first step. 


1.gif 


Step 3


Add the namespace 


2.gif

Now we are ready to perform the query, 


Display all the sites 


3.gif 


Output


4.gif 


Display all the sites which is started 


5.gif 


Output


6.gif 


Display Site running in a particular application pool


7.gif

In above query, we are performing nested query.  We are just comparing if application pool name is as same as given name or not.


Output 


8.gif 


Conclusion 


In above article, I just discussed three basic LINQ query against IIS. I hope this post was useful. Thanks for reading. Happy Coding.
 Subscribe to Articles

     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More Articles on C#, ASP.Net, Vb.Net, SQL Server and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend