I have a connection string inside my app.config
file.
<connectionStrings>
<add name="ConnString"
connectionString="Data Source=|DataDirectory|\STOCK.sdf; Persist Security Info=False;"
providerName="Microsoft.SqlServerCe.Client.3.5"/>
</connectionStrings>
But I have got the following error: when accessing it:
Note: previously I had problem saving the data, and I changed the .sdf
property to "Do not Copy", after that this error is happening.
You should use Server Explorer in Visual Studio to get connection string. Refer here: http://www.codeproject.com/Tips/314772/Using-Visual-Studio-to-find-a-database-connection
Hope this help.