C # .net & # 8594; SQLite error: cannot open database file

I get a "System.Data.SQLite.SQLiteException: Cannot open the database file." when I try to access the database to save a record the first time I open my program.

In this case, it works fine when debugging locally in Visual Studio, but stops working when I pack the program into the installer, and then install the program somewhere.

I assumed that this is the location of the database, which I just installed in database.s3db without a path, because it is stored next to the exe program, but how can this cause problems?

I am at a loss, any further ideas or suggestions to solve this problem will be greatly appreciated.

+3
source share
1 answer

Perhaps you are installing the program in a folder in which the user does not have write permissions, so it is impossible to change the database file.

+5
source

Source: https://habr.com/ru/post/1783078/


All Articles