1

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...

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
michal
  • 37
  • 2
  • 7
  • Someone maged to connect using TCP/IP https://stackoverflow.com/questions/49869499/error-using-entity-framework-core-with-sql-server-on-uwp-app?noredirect=1#comment86805044_49869499 – mindlid Jul 18 '19 at 00:13

4 Answers4

5

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

Ken Tucker
  • 4,126
  • 1
  • 18
  • 24
  • I have tried to install `Install-Package Microsoft.EntityFrameworkCore.SqlServer` in my UWP application but encountered the same issues. I guess it's still in infancy stage to use EF Core.SqlServer, but Microsoft.EntityFrameworkCore.SqlLite works. – Junius Apr 03 '17 at 03:47
0

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

Sapan Ghafuri
  • 545
  • 3
  • 13
  • 1
    The question asks about EF and the article says nothing about EF. If I posted a short answer like that then I would get voted down. – Sam Hobbs Apr 27 '18 at 22:14
0

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
Trevy Burgess
  • 499
  • 5
  • 12
0

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

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community May 31 '22 at 17:21