To set the password:
public static void SetPassword ()
{
var con = new SQLiteConnection(connectionString);
con.Open();
con.ChangePassword(PASSWORD);
con.Close();
}
To remove the password:
public static void ReSetPassword()
{
var con = new SQLiteConnection(connectionString);
con.Open();
con.ChangePassword("");
con.Close();
}
To open the encrypted database programmatically, append the password to the regular connection string:
connectionString += "Password=" + thePassword + ";";