web.config question 2.0



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.



.



Relevant Pages

  • asp.net 2...where do you put your DB connection strings?
    ... I've been taught that, at least in 1.1, you put your DB connection strings ... The wizard itself says: "Do not store sensitive information, ... it looks like it just sticks the app setting back in the web config ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: web.config question 2.0
    ... 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. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: I still cant figure out .net 2.0 DB Connection Strings
    ... I'm still stuck on db connection strings. ... I have a connection string in my web config: ... Object reference not set to an instance of an object. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: I still cant figure out .net 2.0 DB Connection Strings
    ... I'm still stuck on db connection strings. ... I have a connection string in my web config: ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Feature is not available?
    ... FoxPro 6 dbf tables. ... Unfortunately the same connection strings that ... with my web app don't seem to work in Winforms. ...
    (microsoft.public.fox.programmer.exchange)