SQLCe local db in temp- path in connectionstring?
- by Petr
Hi,
I have SQL Ce db in my app, which is included in my app directory. While debugging its OK, but when published and run with setup.exe, it retrieves "file not found" in temporary directory the app is ran from. I would like to run from standard location, but I dont know how to change it.
I am using this string:
SqlCeConnection connection = new SqlCeConnection("Data Source=database.sdf;Persist Security Info=False;");
When I run setup.exe, the app never starts, stating that in its temporary directory the db file was not found. When I run app.exe, it works. I do not understand it...:(
EDIT: I can see that in the VS project settings, there is connection string and there is "Data Source=|DataDirectory|\Database.sdf"
The path should be something like local directory? Thanks!