Re: web.config question 2.0
- From: "eagle" <eagletender2001@xxxxxxxxx>
- Date: Sun, 15 Jul 2007 14:52:17 -0600
Thanks so much! It's now working! The reason we want all our apps to use
one set of connection strings is because we have several different domains
and dev, test and production servers on each of them, all with different
server names. Inevitably someone forgets to change the web.config when the
upgrade 15 different servers; best case the app gets an error, worse case
someone is hitting a test server database without realizing it. Of course,
this shouldn't happen, but it did, so we're putting as much into place as we
can to prevent that. We're starting with a main web.config on each server
to contain the connection strings for all our apps to use.
"eagle" <eagletender2001@xxxxxxxxx> wrote in message
news:OpmrRvjxHHA.536@xxxxxxxxxxxxxxxxxxxxxxx
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.
.
- References:
- web.config question 2.0
- From: eagle
- web.config question 2.0
- Prev by Date: excel charts using asp.net
- Next by Date: Re: excel charts using asp.net
- Previous by thread: Re: web.config question 2.0
- Next by thread: Re: web.config question 2.0
- Index(es):
Relevant Pages
|