Question

I want to create a different project in .Net. That will be used for encryption and decryption of SQLite database. I am using this code for encryption, which is working:

SQLiteConnection cnn = new SQLiteConnection("Data Source=c:\\test.db3");
cnn.Open();
cnn.ChangePassword("mypassword");

But i want to decrypt the database and for that i am using this code for decryption:

SQLiteConnection cnn = new SQLiteConnection("DataSource=c:\\test.db3;Password=mypassword");

cnn.Open();
cnn.ChangePassword(null);

But the code cnn.ChangePassword(null); shows the below error:

   The call is ambiguous between the following methods or properties: 'System.Data.SQLite.SQLiteConnection.ChangePassword(byte[])' and 'System.Data.SQLite.SQLiteConnection.ChangePassword(string)' 

I found this useful link for the above code

http://gater3.rssing.com/chan-3257136/latest.php

but I don't where i am doing mistake.

Needs help.Thanks in advance.

Was it helpful?

Solution

Do try this first

cnn.ChangePassword(String.Empty);

then

cnn.ChangePassword((String)null);

or

cnn.ChangePassword(default(byte[]));
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top