?
Solved

Access Web.config in ASP .NET Web Application from seperate Class Library Project

Posted on 2005-02-24
5
Medium Priority
?
1,113 Views
Last Modified: 2008-01-09
So I have this hierarchy:

+ Solution
|
|--- + Class Library Project
|     |
|     |--- LogError.vb
|
|--- + ASP .NET Web Application
      |
      |--- Web.config

I want to access from Web.config:

<appSettings>
       <add key="sqlConnString" value="myDBString">
</appSettings>

from LogError.vb. Anyone know how I would go about doing this?
0
Comment
Question by:bradtm
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 3

Accepted Solution

by:
teejay21 earned 800 total points
ID: 13399624
ConfigurationSettings.AppSettings("sqlConnString")
0
 

Author Comment

by:bradtm
ID: 13399655
You can't access ConfigurationSettings.AppSettings from a seperate Class Library Project.
0
 
LVL 3

Expert Comment

by:teejay21
ID: 13399788
Yeah sorry - didn't see his comments "from LogError.vb".

0
 
LVL 1

Assisted Solution

by:jackrocks
jackrocks earned 800 total points
ID: 13399875
You can access teh web.config file from Class Project if you both the projects are in the same solution. ConfigurationSettings.AppSettings("sqlConnString") shoudl work.
0
 
LVL 4

Assisted Solution

by:kaliyappan_k
kaliyappan_k earned 400 total points
ID: 13400089
you have to reference the System.Configuration namespace to access it, and @jackrocks suggestion should work for you.

Cheers
Kaliyappan
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question