0

I can create a DB Connection in Xamarin using the following code:

    var options = new SQLiteConnectionString(dbPath, true, dbPassword, postKeyAction: c =>
    {
        c.Execute("PRAGMA cipher_compatability = 3");
    });

 SQLiteConnection connection = new SQLiteConnection(options);

But the same code when I try to use it in .Net Maui with the .net7.0 version. It is not working and giving the following Error.

SQLite.SQLiteException: file is not a database Result:

SQLite.SQLite3+Result.NonDBFile

Nu-get Package which I have used:

Xamarin => sqlite-net-sqlcipher version:1.8.116

.NetMaui => sqlite-net-pcl version:1.8.116

7
  • Well aren't you using the Wrong NuGet in that case evidently
    – FreakyAli
    Commented Feb 7, 2024 at 8:10
  • @FreakyAli Am using the Nuget package which they mentioned in the dotnet documentation (learn.microsoft.com/en-us/dotnet/maui/data-cloud/…)
    – iTag
    Commented Feb 7, 2024 at 8:17
  • But you need Cipher compatibility that comes with sqlcipher, change your Nuget and things will work fine
    – FreakyAli
    Commented Feb 7, 2024 at 8:19
  • @FreakyAli Can you tell me which Package i should use here to solve this issue?
    – iTag
    Commented Feb 7, 2024 at 8:56
  • @FreakyAli Even i have tried with SQLitePCLRaw.bundle_green Nuget package along with sqlite-net-pcl . And i did setup on Appdelegate SQLitePCL.raw.SetProvider(new SQLitePCL.SQLite3Provider_sqlite3()); But its not working
    – iTag
    Commented Feb 7, 2024 at 9:15

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.