Code Bye

file is encrypted or is not a database

创建SQLite数据库后,为了保护数据安全性,考虑为数据库加密,由于一直在使用navicat for sqlite管理SQLite,所以加密操作也使用了navicat for sqlite,右键数据库-Encrypt DataBase ,然后设置了密码。
但是在用代码调用时,无法连接成功,抛出异常“ file is encrypted or is not a database ”,代码如下:
连接字符:
SQLiteConnectionStringBuilder sqliteSb = new SQLiteConnectionStringBuilder();
            sqliteSb.DataSource = dbPath;
            sqliteSb.Password = “password”;
            this.connectionString = sqliteSb.ConnectionString;
连接:
SQLiteConnection connection = new SQLiteConnection(connectionString);
connection.Open();// 异常
原因未找到,待找到后补充,如有知道的欢迎留言。Tks

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明file is encrypted or is not a database