Using SQLite-NET with UWP
Asked Answered
G

2

7

I downloaded the package from NuGet and still there's no SQLite.cs neither SQLiteAsync.cs added to the project, If SQLite-NET is still not supporting VS 2015 RTM, Any possible alternatives?

Note that I tried SQLite.NET-PCL and still the same problem.

Groping answered 6/8, 2015 at 7:58 Comment(3)
That's really a question for the project's forum or GitHub site, not SO. Have you tried using the SQLite ADO.NET provider?Sole
@PanagiotisKanavos It seems to me not supported either. Last version was updated May 2015.Groping
@Groping - Did you find a solution for SQLite-NET? Because even I am not able to find any sqlite.cs added to my project.Cnidoblast
C
12

SQLite.NET-PCL shouldn't add those two classes directly to your project files.

Did you download the right SQLite.NET-PCL via NuGet? (there's a huge mess when you search for SQLite.NET on NuGet so it's easy to get confused and install the wrong one).

The right SQLite.NET PCL library

Did you install the SQLite VSIX package for Universal App Platform development using Visual Studio 2015. Did you add it to your project references?

Have you tried reading my blog post on this topic: Using SQLite in Windows 10 Universal apps?

Everything should work OK with VS 2015 RTM.

Cotswold answered 6/8, 2015 at 9:25 Comment(6)
I followed the tutorial. The UWP runs prefectly on Local Machine but when it runs on a mobile device or an emulator, I am getting an sqlite3.dll not found error. Is this tutorial working for you when you run it on mobile?Drucill
I'm having exactly the same problem. Kinda frustrating. An updated working sample with the correct versions and references would be helpful.Shumate
@TreyBalut the sample still works. I was able to run the app with the latest SQLite package 3.9.1. on both local machine and emulator. Did you add the "SQLite for Universal App Platform" extension to project references?Cotswold
Be sure that you add "Visual C++ 2015 Runtime for Universal Windows Platform Apps" with a version 14.0Whitsun
@igrali: I also get Unable to load DLL 'sqlite3'. Setup: sqlite-uwp-3130000.vsix, SQLite.Net-PCL v3.1.1. I have references for both. App crashes at this line var platfrom = new SQLite.Net.Platform.WinRT.SQLitePlatformWinRT(); Doesn't work on device (10.0.10586.218) on also not on simulator (10.0.10586.0), but on local machine it works. It also seems that I'm not the only one with this problem. It would be nice if you could give an update on this.Schrock
OK. Now I added Visual C++ 2015 Runtime for Universal Windows Platform Apps and it seems to work. Thanks!Schrock
B
0

The question was about sqlite-net but the answer was about SQLite.NET-PCL. I too ran into the same problem with sqlite-net on UWP. It turns out this is a known issue. See here from the GitHub page (issue 391):

https://github.com/praeclarum/sqlite-net/issues/391

Adding sqlite-net NuGet to Universal Windows project doesn't add SQLite.cs or SQLiteAsync.cs to project #391

Barbette answered 7/4, 2016 at 15:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.