我想在.Net中创建一个不同的项目。这将用于SQLite数据库的加密和解密。我正在使用此代码进行加密,这是有效的:
SQLiteConnection cnn = new SQLiteConnection("Data Source=c:\\test.db3");
cnn.Open();
cnn.ChangePassword("mypassword");
但我想解密数据库,为此我使用此代码进行解密:
SQLiteConnection cnn = new SQLiteConnection("DataSource=c:\\test.db3;Password=mypassword");
cnn.Open();
cnn.ChangePassword(null);
但是代码cnn.ChangePassword(null);显示以下错误:
The call is ambiguous between the following methods or properties: 'System.Data.SQLite.SQLiteConnection.ChangePassword(byte[])' and 'System.Data.SQLite.SQLiteConnection.ChangePassword(string)'
我找到了上述代码的有用链接
http://gater3.rssing.com/chan-3257136/latest.php
但我不知道我在做错了。
需要帮助。谢谢。
答案 0 :(得分:2)
先试试这个
cnn.ChangePassword(String.Empty);
然后
cnn.ChangePassword((String)null);
或
cnn.ChangePassword(default(byte[]));