I'm having trouble accessing my sqlite database after I install the program with InstallShield. I have the database referenced in the app.config file like shown below
<add name ="Database" providerName="System.Data.Sqlite" connectionString="Data Source =|DataDirectory|CKDatabase.db"/>
this is referenced by my c# code like shown below
string connectionStringCKDatabase = System.Configuration.ConfigurationManager.ConnectionStrings["Database"].ConnectionString;
When I install the program the database is included with the reference libraries and the application, but when I logon the error says "unable to open database file". The database doesn't have to be buried somewhere complex. It's just a simple reference. Obviously it works fine in regular debug mode. I know this is an easy question but I feel performing an install has very few resources for learning.
You have a permission problem. |DataDirectory|
in desktop applications is the same folder where you have installed the application and if this is "Program Files" you usually don't have write permission there. Try to temporary set the permission read/write to everyone on that folder. If this solves the problem then study how to deploy your database file in a folder where you have read/write permissions like ProgramData