Reputation: 907
I am writing a small library that all it does is opens a connection with the local SqliteDb present just near the application and reads from the database depending on the search query.
The one using this library does not need the access to Insert or update any record but are updated from lets say me.
SO to create a database i use this:
SqlConnection = new SQLiteConnection("Data Source=Languages.db;Version=3;New=True;Compress=True");
Than to access the database the same but New=False
Now i am using Firefox Sqlite Manager to modify the table such as creating the structure and adding values.
But when i save the file with firefox i get an error on C# stating that it is write/read protected when i try to open the connection!!
Edit: I also tried to use Sqlite Browser: http://sqlitebrowser.org
but then i got that unsupported file format!
Am i missing something?
Regards
Upvotes: 0
Views: 553
Reputation: 907
I have noticed that when creating a table or altering the table somehow from the SQL manager gui, the gui itself creates some headers/meta data that the driver is not able to read and thus it flags it as corrupted.
To solve the issue all i had to do is create the tables and alter as necessary from my application directly,than i can add records using the firefox manager and it seems to be working correctly!
Correct me if im wrong!
Upvotes: 0
Reputation: 5771
The FireFox SQL Lite Manager when open, restricts other applications from making a connection to the SQL Lite database. If you shut down the FireFox Manager, your C# code will execute correctly.
You can refer this answer to understand the nature of the lock applied by Firefox Firefox locks places.sqlite
Upvotes: 1