Private
Static
String
CONSTRING;
/ ** /
///
public
Static
String
ConnectString
{Get {if (Constring == null) {Constring = string.Format (System.Configuration.ConfigurationSettings.AppSettings [ "ConnectString"], System.Web.HttpContext.Current.Request.PhysicalApplicationPath (System.Configuration.ConfigurationSettings.AppSettings [ "Dbpath"])); return;}}}
See globals.cs
<
Appsettings
>
<
Add
Key
= "ConnectString"
Value
= "Data Source = {0}; password =; provider = microsoft.jet.oledb.4.0"
/>
Data driver
->
<
Add
Key
= "Dbpath"
Value
= "DatabaseHover.mdb"
/>
Physical path
->
Appsettings
>
See Web.config
Always a physical path when calling connectstring
D: /hover/hover.web/database/hover.mdb
HttpRequest.PhysicalApplicationPath properties
Get the physical file system path of the root directory currently being executed