I am using csharp-sqlite library.
The code:
var conn = new SQLite.SQLiteConnection(DatabasePath);
conn.Execute("insert or replace into Option(Key, Value) values ('A', '1')");
conn.Execute("insert or replace into Option(Key, Value) values ('B', '2')");
It works as I expect. However when I use BeginTransaction() and Commit, I get an exception in the second Excute: "CannotOpen", the native is SQLITE_CANTOPEN (error 14).
The code would be:
var conn = new SQLite.SQLiteConnection(DatabasePath);
try
{
conn.BeginTransaction();
conn.Execute("insert or replace into Option(Key, Value) values ('A', '1')");
conn.Execute("insert or replace into Option(Key, Value) values ('B', '2')");
conn.Commit();
}
catch (SQLiteException ex)
{
_conn.Rollback();
}
What am I doing wrong?
Thank you