Hi,
I'm using the .NET 2.0 <connectionString> directives:
<connectionStrings>
<add name="core" connectionString="Data Source=core.db"/>
<add name="delicious" connectionString="Data Source=delicious.db"/>
</connectionStrings>
This is all very nice, but this does not seem to map to a path relative to the web root /
For example, I have all my databases (yes I use more than one) in /data/.
In order to get it working it seems I have to specify the full path on the server,
for example "Data Source=f:/wwwroot/mysite/data/core.db"
(or "Data Source=/srv/www/mysite/data/core.db" on linux).
Instead I would like it so that it doesn't matter where the website is fysically located on the server.
Normally I'd use Server.MapPath but I can't use that because
1) Server.MapPath(SQLiteConnection dbConnection = new SQLiteConnection(ConfigurationManager.ConnectionStrings["core"].ConnectionString));
wouldn't do me any good.
2) I'm not accessing the database from an ASP.NET page, but from a business object in the App_Code directory and Server.MapPath is (by default) not available there.
How do I solve this?
Thank you.