开发者

C# .net -> SQLite error: Unable to open the database file

开发者 https://www.devze.com 2023-02-01 21:17 出处:网络
I\'m getting \"System.Data.SQLite.SQLiteException: Unable to open the database fi开发者_如何学JAVAle.\" when I attempt to access the database to save a record upon the \"first\" opening of my program.

I'm getting "System.Data.SQLite.SQLiteException: Unable to open the database fi开发者_如何学JAVAle." when I attempt to access the database to save a record upon the "first" opening of my program.

Here's the thing, it works fine when debugging locally in Visual Studio, but stops working when I package the program in an installer, and then install the program somewhere.

I was guessing that it was the location of the database, which I just have set at database.s3db without a path, because it is stored next to the program's exe, but how could that cause problems?

I'm at a loss, any further ideas or suggestions for solving this problem would be greatly appreciated.


Maybe you are installing the program in a folder which the user doesn't have write permissions so cannot modify the database file.


Please update your DataSource Format like this :

@"C:\Users\Mehmeto\Documents\Visual Studio 2015\Projects\......\bin\myDB.sqlite";

Where the directory points to where your project is located.

0

精彩评论

暂无评论...
验证码 换一张
取 消