Using Web.Config for Legacy .ASP to get A Connection String

  • Thread starter Thread starter gregory_may
  • Start date Start date
G

gregory_may

I have a mixed ASP.NET and legacy ASP application.

Right now, the .ASP pages use a mix of Hard Coded connection strings and an
"Global Included" file. I would like to use the connection string in the
Web.Config for all the Legacy .Asp pages.

Anyone know of a good way to do this? Here is a snip of my Web.Config (from
one system).

I thought about doing a simple text search on "DataConnectionString" and
pulling the "Value", but I thought there may be a better way?

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="dataconnectstring" value="user id=ID;password=Pass;initial
catalog=cat;data source=source;pooling='false'" />
 
Back
Top