Error in SQLite: "attempt to write to readonly database"

1

All the queries work well for me but when I try to do a insert in SQLite I get the following error:

  

attempt to write to readonly database

    
asked by Mike 04.07.2017 в 20:47
source

2 answers

1

I already solved it

The error was caused because my database was .SQLite and the solution was to change it to .db Thanks for the help

    
answered by 05.07.2017 в 21:51
0

It seems that the problem you have is that you create the database without security, so when you try to connect to it, it does not leave you.

You should indicate a password when creating the database and in the connection string indicate the password:

SQLiteConnection conn = new SQLiteConnection("DataSource=MyDatabase.sqlite;Version=3;");
conn.SetPassword("password");
conn.open();

I hope it helps you.

    
answered by 05.07.2017 в 11:17