michal
michal

Reputation: 37

Use Entity Framework with SQL Server in UWP

I am starting to learn UWP platform. In first steps I want to do simple application (bookshop). Unfortunately, I got stuck on steps: how to use Entity Framework with SQL Server in UWP?

First I was using

Install-Package Microsoft.EntityFrameworkCore.SqlServer

but I got lots of conflicts (ex. System.Threading.Thread 4.3.0 error, or One or more packages are incompatible with UAP,Version=v10.0 (win10-x86).).

After that, I was trying add a classic dll to project (and install ef), but... classic library are incompatible with UWP...

Do you have any idea how to use EF with SQL Server in UWP ? I don't want to use sqlite...

Upvotes: 1

Views: 4521

Answers (4)

I successfully connected ms sql, entity framework to uwp. They work together.

To connect, I used an additional project "csproj" with the standard .NetStandard 2.0 in the same solution. I also used "Microsoft.EntityFrameworkCore.SqlServer" in this project, not in the UWP project. It was just class library

Upvotes: 0

Trevy Burgess
Trevy Burgess

Reputation: 499

To use SQLite in your UWP app, you need to target Windows 10 Fall Creators Update (10.0; Build 16299)

The NuGet packages are:

  • Microsoft.EntityFrameworkCore.Sqlite
  • Microsoft.EntityFrameworkCore

Upvotes: 0

Sapan Ghafuri
Sapan Ghafuri

Reputation: 555

The latest version of Windows SDK (Falls Creators Update) will support direct SQL Server connection. Have a look at it here: https://learn.microsoft.com/en-us/windows/uwp/data-access/sql-server-databases

Upvotes: 0

Ken Tucker
Ken Tucker

Reputation: 4156

Sorry you can only use the entity framework SQLite provider with UWP.

Upvotes: 5

Related Questions