Chris Roberts
Chris Roberts

Reputation: 18802

How do I install SQLite for use in a Universal Windows App targetting UAP v10

I'm trying to get SQLite working in a Universal Windows App targeting UAP v10 using Visual Studio 2015 (RTM).

I've installed the Visual Studio Extension, "SQLite for Universal App Platform" and referenced it (and "Visual C++ 2015 Runtime for Universal Windows Platform Apps") from my project.

I've then added System.Data.SQLite via NuGet, which appears to work as a reference to it gets added to my project and I don't see any error messages. However, I don't appear to get any DLLs added to my project through this process.

Upon further investigation, it looks as though the System.Data.SQLite NuGet package is actually empty, but lists the following as dependencies...

  1. System.Data.SQLite.Core
  2. System.Data.SQLite.Linq
  3. System.Data.SQLite.EF6

So - I tried adding each one of these through the Package Manager Console and received the following error...

Install-Package : System.Data.SQLite.Core 1.0.98.1 is not compatible with UAP,Version=v10.0.

This seems like a fairly conclusive error message. So what do I do now... is SQLite actually supported for Windows 10 Universal Apps at the moment or not? Documentation I can find on the web seems pretty contradictory or at least seems to imply that I should be able to do what I'm trying to do.

Any help / pointers would be appreciated!

Upvotes: 2

Views: 9581

Answers (5)

Julia B
Julia B

Reputation: 35

SQLite is supported for Universal Windows platform.

C# solution

  1. Install SQLite for Universal Windows Platform Visual Studio extension.
  2. Use SQLite C# API Wrapper Microsoft.Data.SQLite. More information here.

C# or C++/CX solution

  1. Install SQLite for Universal Windows Platform Visual Studio extension.
  2. Add reference to SQLite for Universal Windows Platform extension to your project:

Project => References => Universal Windows => Extensions => SQLite for Universal Windows Platform

  1. Write your own wrapper using low-level SQLite API in C# or C++.

C++/CX solution

This SQLite-WinRT wrapper is handy for UWP apps written in C++/CX.

Upvotes: 0

ktingle
ktingle

Reputation: 374

Since the Windows 10 Anniversary Update (Build 14393), SQLite has also shipped as part of the Windows SDK

This link explains everything:

https://blogs.windows.com/buildingapps/2017/02/06/using-sqlite-databases-uwp-apps

Upvotes: 0

Mamoru Satoh
Mamoru Satoh

Reputation: 2710

Win10 UWP(UAP) and Win8.1/WP8.1 Store App does not support ADO. System.Data.SQL is an ADO provider, then it's not applicable for UWP, I believe.

To using SQLite on UWP, you need to have SQLite itself and wrapper for .NET.

SQLite - SQLite (Visual Studio Extension)

SQLite wrapper for .NET (NuGet) - SQLite.Net-PCL or SQLite.Net.Async-PCL

And, following link may helps you. It's a VB guy's blog =) but very insightful for uwp works.

Win10 apps in .NET - references

Edited 7 Feb 2017: Windows 10 Anniversary Update(1607) support the SQLite as "Microsoft.Data.SQLite".

Using SQLite databases in UWP apps - Windows blog

Upvotes: 3

Jonathan Allen
Jonathan Allen

Reputation: 70337

Looks like Microsoft is building a version. As of this comment, they are in release candidate 1.

https://github.com/aspnet/Microsoft.Data.Sqlite

Upvotes: 1

Simon Price
Simon Price

Reputation: 3271

go to http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki and download the right installer for the .net framework youre using.

this will register the dll's for you and give you everything you need

Upvotes: 0

Related Questions