Re: web.config question 2.0

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Thanks for all the comments, I now have a lot of information to decide what
we're going to do. We do use the current app's web.config for anything that
is specific to that application, but we've been talking about changing that
too. Others in my group want to put all the assemblies into the root
web.config, and I disagree. If you change the reference to an assembly in
the root reference newer versions of that assembly, then it could break
everything. Their argument is that we should be updating all our
applications when we get new versions. Who the heck has that kind of time.
Same argument for mixing 1.0/2.0, they think we should upgrade all our 1.0
apps.

This leads me to another question since it sounds like you all have some
better organization ideas: some in our group say the same thing about our
proprietary components, that when we get a new component, we should upgrade
all our thousands of apps to that new component. Again, who has the time.
What happens is we'll have an older app that has a bug, and it breaks when
we attempt to use the new component; however, in many cases we have no idea
what version of that component the app was originally created with, and many
times couldn't find the older one even if we knew which one we needed. All
of our apps are stored in source safe. In order to prevent this in the
future, others in our group think we should store the dll's in source safe
with the application, then we could upgrade it when we can, rather than when
we have to fix a bug that will take 30 seconds and the director is standing
over your shoulder. I've heard that storing dll's in source safe is not a
good idea. What do most people do?

"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.





.



Relevant Pages

  • Re: Connection string / design question
    ... Hitchhiker's Guide to Visual Studio and SQL Server ... I have a question regarding the handling of connection strings. ... application - windows forms apps, web apps, web services and windows ... them connect to the same database. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: web.config question 2.0
    ... someone is hitting a test server database without realizing it. ... to contain the connection strings for all our apps to use. ... I get an "Object reference not ...
    (microsoft.public.dotnet.framework.aspnet)
  • Connection string / design question
    ... I have a question regarding the handling of connection strings. ... application - windows forms apps, web apps, web services and windows ... them connect to the same database. ...
    (microsoft.public.dotnet.framework.adonet)
  • 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: Tried out iMac/Leopard
    ... Leopard is pretty, but an ugly POS when it comes to doing anything. ... Slow to launch apps, the browser, and Finder. ... hours for the upgrade. ... This was a clean install. ...
    (comp.sys.mac.advocacy)