I set an encryption key for my database in DB Browser for SQLite and now I cannot access it in C#.
Here's the relevant code:
private SQLiteConnection connection;
public DbManager()
{
connection = new SQLiteConnection("Data Source=DB\\gamedb.encrypted.sqlite;Password=p4ssw0rd;Version=3;");
connection.Open();
}
The SQLiteCommand below throws an exception: "file is encrypted or is not a database".
public Dictionary<string, string> ReadMaps()
{
SQLiteDataReader reader = new SQLiteCommand("select * from Map", connection).ExecuteReader();
Dictionary<string, string> res = new Dictionary<string, string>();
while (reader.Read())
res[(string)reader["Name"]] = (string)reader["Data"];
return res;
}
Is the key specified in the DB browser a different thing than a password?