I’m trying to use an ‘SQL Express’ (or is it SQL Compact?) .MDF file as the datasource on a simple website using a Chart control.
Locally, it works great; but only if the ‘AttachDbFilename’ has the full path. Am I messing something up, or does it really need to be full path? If so – how do I accomplish this without using something like Server.MapPath()?
By default, the |DataDirectory| variable will be expanded as follow:
You can programmatically set DataDirectory by calling
AppDomain.CurrentDomain.SetData("DataDirectory", newpath)