SQLCipher for ADO. NET "file is encrypted or is not a database"


#1

Hi.
i’m using trial version of SQLCipher for ADO.Net. My code:

var DB:SQLiteConnection := new SQLiteConnection (‘Data Source=’+DBName+’; Password=mypass’);

DB.Open;
var cmd:SQLiteCommand := DB.CreateCommand ;
cmd.CommandText := ‘SELECT * FROM store;’;
var reader := cmd.ExecuteReader();
//in this line error message “file is encrypted or is not a database”

But SQLiteManager open this base successfully.


#2

Hello @diagtruck

Would you try setting up your DB instance like this:

var DB:SQLiteConnection := new SQLiteConnection ('Data Source='+DBName+';Password=mypass;SetDefaults=false;');


#3

No result. Same error.


#4

Database dump.


#5

Unfortunately the database dump won’t be very helpful in diagnosing this. Are you creating the database using SQLiteManager? Can you try to create a new database using SQLCipher in ADO.NET, i.e. without SQLiteManager?


#6

No. Database not creating using SQLiteManager. But SQliteManager open this base.