Hi, I'm trying to connect a Linq-to-SQL context to a database with a relative path using DataDirectory but I get the following error:
"You need to specify the full path to an executable file"
My data access class constructor in a separate DLL looks like this:
In the app.config folder for the same DLL I have this:Code:Private Sub New() dc = New MilkywayDataContext() End Sub
And in the web.config for the main project, I have the exact same.Code:<connectionStrings> <add name="MilkywayDataContext" connectionString="data source=(LocalDB)\v11.0; AttachDbFilename =|DataDirectory|\MilkywayDB.mdf;Integrated Security=True" providerName="System.Data.SqlClient" /> </connectionStrings>
I don't know why it's not working as I have another project which uses the same method, albeit as an Entity Framework Model, and it works fine.
Any help will be greatly appreciated!




Reply With Quote