G
Guest
Using Asp.NET 1.1, and C#.
I have a directory for the website, and a directory under it named Secure.
I have a web.config in each of the above directories. The web.config in the
Secure directory contains the connection string information for the database.
How can I use ConfigurationSettings.AppSettings to show the path of the
Secure directory when getting the connection string?
Shown below is a sample, but it is not passing the path.
We plan to use Windows security on the Secure folder, and add the AspNet
worker process id to avoid most everyone from having access to the Secure
folder contents.
web.config:
<appSettings>
<add key="ConnectionString" value="server=...;database=...;user id=...;
password=...;" />
</appSettings>
In your connection code:
SqlConnection conn = new
SqlConnection(ConfigurationSettings.AppSettings["ConnectionString"]);
I have a directory for the website, and a directory under it named Secure.
I have a web.config in each of the above directories. The web.config in the
Secure directory contains the connection string information for the database.
How can I use ConfigurationSettings.AppSettings to show the path of the
Secure directory when getting the connection string?
Shown below is a sample, but it is not passing the path.
We plan to use Windows security on the Secure folder, and add the AspNet
worker process id to avoid most everyone from having access to the Secure
folder contents.
web.config:
<appSettings>
<add key="ConnectionString" value="server=...;database=...;user id=...;
password=...;" />
</appSettings>
In your connection code:
SqlConnection conn = new
SqlConnection(ConfigurationSettings.AppSettings["ConnectionString"]);