PDA

View Full Version : web.config


MikeKovach
02-21-2005, 06:26 AM
How can I reference the _database directory in the web.config so I do not have to always reference the _database directly.

What I'm thinking about is somthing like the following:

<appSettings>
<add key="NWind"
value="Provider=Microsoft.Jet.OleDb.4.0; data source=<server drive letter>:\\web\\<sitename> \\htdocs\\_database\\Northwind.mdb;";/ ('file://\\htdocs\\_database\\Northwind.mdb;";/')>
</appSettings>

Then in the connect string I would simply have to put the following:

String strConnection = ConfigurationSettings.AppSettings["NWind"];

bruce
02-21-2005, 07:48 AM
You should be able to find the root path in the account information section in the control panel.

Bruce

DiscountASP.NET
www.DiscountASP.NET (http://www.DiscountASP.NET)

MikeKovach
02-21-2005, 09:16 AM
Thanks Bruce. Shortly after I posted the message I got it working.

MikeKovach
02-21-2005, 09:56 AM
Well here's another issue with Web.config.


I added another key value the first dB reference key works fine but the new one states the following:


Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

Based on the above I would say there are security limiteations onweb.config so I need to ask that if this is the case is there something I can do to permit multiple keys that you're aware of?

MikeKovach
02-21-2005, 10:04 AM
Never mind my last got it.