...

View Full Version : Application-level ASP.NET objects



AEternal
12-05-2003, 03:57 AM
Hi folks! First post here.

I have an ASP.NET application, and I'd like to make it so that I only have to set the connection object in one place for the entire app. I know classic ASP apps can use Global.asa to set variables like this, but it doesn't seem to work if I create a connection object in Global.asax.

Does anyone have any suggestions or best practices for this?

Thanks!

angiras
12-05-2003, 07:53 AM
into the web.config

<appSettings>
<add key="DataSource" value="Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:\inetpub\wwwroot\angiras\DataBase\angiras.mdb" />

and you call it

myconn = configurationSettings.Appsettings("DataSource")

AEternal
12-07-2003, 03:03 AM
Thank you kindly, angiras. :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum