dimanche 9 août 2015

Universal Windows App Using SQLite

I'm getting the following error:

  Message=The type initializer for 'SQLitePCL.raw' threw an exception.
Message=Unable to load DLL 'sqlite3': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

Below is my code:

int recCtr = 0;
        var root = Windows.Storage.ApplicationData.Current.LocalFolder.Path;
        var dbPath = Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path, dbName);
        List<string> myCollection = new List<string>();
        string tempDeckGroup = Global.currentDeckGroup.ToString() + Global.currentDeck.ToString();

        using (var db = new SQLite.SQLiteConnection(dbPath))
        {
            var list = db.Table<Decks>().Where(n => n.DeckGroup == tempDeckGroup).ToList();
            foreach (var item in list)
            {
                recCtr++;
                myCollection.Add(item._id.ToString() + "~" + item.WordName.ToString() + "~" + item.Definition.ToString());
            }
        }

The error occurs when I run the app using the Microsoft Phone Emulator. The code executes with no errors if I deploy to a Local Machine or Simulator.

I'm using the latest SQLite refernces (VSIX) and SQLite-net.pcl

I don't have a physical device to test on. (Windows 10 Phone)

Aucun commentaire:

Enregistrer un commentaire