web.config question 2.0
- From: "eagle" <eagletender2001@xxxxxxxxx>
- Date: Sat, 14 Jul 2007 11:22:41 -0600
I have a web.config in my application that contains the connection strings
to all my datasources. I want to move these connection strings to another
web config up the folder hierarchy so that all my apps can use the same
connection strings. That is supposed to be how it's done, no? Instead of
the web.config being in c:\inetpub\wwwroot\myApp\web.config, I have it in
c:\inetpub\wwwroot\web.config. However, I get an "Object reference not set
to an instance of an object" error when I do this. This used to work fine
in Visual Studio 2003 .net 1.0.
My connection string is fine:
<connectionStrings>
<add name="myDB" connectionString="Data Source=mySvr;Initial
Catalog=myDB;Integrated Security=True "/>
</connectionStrings>
And this is how I retrieve in in the web app:
_sSQLConn =
System.Configuration.ConfigurationManager.ConnectionStrings("myDB").ToString
What am I doing wrong?
Thanks for your help.
.
- Follow-Ups:
- Re: web.config question 2.0
- From: eagle
- Re: web.config question 2.0
- From: Juan T. Llibre
- Re: web.config question 2.0
- From: Nathan Sokalski
- Re: web.config question 2.0
- Prev by Date: Using VS 2005 Db Explorer and FTP through a Proxy
- Next by Date: Re: Windows Presentation Foundation (WPF)
- Previous by thread: Using VS 2005 Db Explorer and FTP through a Proxy
- Next by thread: Re: web.config question 2.0
- Index(es):
Relevant Pages
|