file is encrypted or is not a database

数据库 码拜 9年前 (2014-11-24) 2953次浏览 0个评论
创建SQLite数据库后,为了保护数据安全性,考虑为数据库加密,由于一直在使用navicat for sqlite管理SQLite,所以加密操作也使用了navicat for sqlite,右键数据库-Encrypt DataBase ,然后设置了密码。
file is encrypted or is not a 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
喜欢 (0)
[1034331897@qq.com]
分享 (0)

文章评论已关闭!