UWP SQL connection Error [c#]

windows universal app sql server
uwp connect to mysql
uwp cannot connect to sql server
uwp mongodb
microsoft.data.sqlite create database
uwp development
how to use sqlite in visual studio 2017
sql server connection

I try to connect to a SQL Server 2008 instance with SQL Server credentials.

With a WPF app, I have no problem.

I follow this example: https://docs.microsoft.com/en-us/windows/uwp/data-access/sql-server-databases

I have read this: How to connect to SQL server database from a Windows 10 UWP app

My connection string is:

static private string connectionString = 
     @"Data Source=SERVER\SQLSERVER;Initial Catalog=Something;
       Integrated Security=false;Persist Security Info=True;User ID=user;Password=pass";

conn = new SqlConnection(connectionString);

catch(Exception z)

I get this error

System.Data.SqlClient.SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred during the login process. (provider: TCP Provider, error: 0 - L’opération a réussi)

If I try

static private string connectionString = 
    @"Data Source=SERVER\SQLSERVER;Initial Catalog = Something;
      Integrated Security=true;User ID = user;Password= pass";

I get this error

System.Data.SqlClient.SqlException (0x80131904): Failed to generate SSPI context. ErrorCode=DowngradeDetected

The same error with Integrated Security=SSPI

If someone has an idea please?

Thanks Benoit

You need to check the appropriate capabilities in your appx manifest that are required for accessing the resource on your network. Open Package.appxmanifest in VS and go to the 'Capabilities' tab.

Use a SQL Server database in a UWP app, Trouble connecting to your database? Next steps. Your app can connect directly to a SQL Server database and then store and retrieve data by  I'm connecting to a SQL server on another PC in our network. While coding this UWP app (using the latest versions of everything, i.e., SQL, Windows 17763) everything works fine. Queries are returning

  1. Try this code

    optionsBuilder.UseSqlServer("Data Source = SERVER\SQLSERVER; Initial Catalog = Something; Integrated Security = False; User Id = user; Password = pass; MultipleActiveResultSets = True");

  2. Make sure that the TCP is enabled in the SQL Server Configuration Manager

  3. I remember   The case can be solved by installing a small repair for the server Before that, try another server

  4. I remembered the third case Install Kerberos See link https://support.microsoft.com/en-us/help/811889/how-to-troubleshoot-the-cannot-generate-sspi-context-error-message Download and install from the link https://www.microsoft.com/en-us/download/details.aspx?id=39046

Use a SQLite database in a UWP app, Use a SQLite database in a UWP app. Connection = db; // Use parameterized query to prevent SQL injection attacks insertCommand. By default you connect to a local SQL instance using the Shared Memory protocol, which doesn't appear to work at all from UWP. So you have to enable TCP/IP. If I force Shared Memory in the connection string Server=lpc:localhost;

I try with a new VM and SQL EXPRESS 2014 It's working.

I think UWP and SQL SERVER 2008 are not compatible.

Thanks for your help Rami.


T680710, UWP SQL connection Error [c#] To be able to use SSPI in a UWP application, one needs to enable 'Enterprise Authentication' as a capability  I'm getting an exception when trying to open a connection to the database using this code in a C# UWP 10 application on Visual Studio 2017: private readonly IDbConnection dbConnection; pu

System.Data.SqlClient 4.5.0-rc1 in an UWP application can not , (Provider TCP Provider, error 40 - Could not open a connection to SQL ServerTCPIP is enabled in the SQL SqlConnection.Open() at SQLDBDiagrammGenerator.UWP. App 2.1.0 [C:\Program Files\dotnet\shared\​Microsoft. I'm trying to connect to an on-prem MS SQL database from a universal windows app. I'm making a LOB app using UWP, to support desktop, tablet and mobile use. When trying to connect to a local (intra

SQL Server Installed Compatible Minimum Version not documented , SQL Server Installed Compatible Minimum Version not documented #1319 .​com/questions/50104824/uwp-sql-connection-error-c?rq=1. Use a SQL Server database in a UWP app. 03/28/2019; 4 minutes to read +3; In this article. Your app can connect directly to a SQL Server database and then store and retrieve data by using classes in the System.Data.SqlClient namespace.

UWP connection to SQL Server, I'm getting some errors when i build my application to UWP. BuildPlayerOptions options) [0x0021f] in C:\buildslave\unity\build\Editor\Mono\ According to Microsoft the SQL server connection is only possible directly in the  Check out the links below to learn about other ways to use data in your UWP app. Next steps. Connect your app directly to a SQL Server database. See Use a SQL Server database in a UWP app. Share code between different apps across different platforms. See Share code between desktop and UWP. Add master detail pages with Azure SQL back ends

  • The following boxes are checked: Internet (client) Internet (Client and Server) Private network Enterprise authentification
  • 1. Same error 2. TCP is enable 3. I have no other server for testing. Where can I download the fix, please?
  • I modified the answer by adding a new solution I think will solve your problem
  • I tried it, it seems not working. When I launch kerberos test, I ve got an error. Let me the end of the Week to make more testing. You may right, probably uwp app wants sspi connection. My server may be not configure correctly for this type of connection. For Info, it is win srv 16 with mssql2008. This server has no domain.
  • I think the Windows Installer service does not work for your windows Maybe the error you got is yours The Windows Installer Service Could Not Be Accessed Try running and repairing Windows Installer As in the article or try another article windowsreport.com/…
  • Another suggestion Try using a free or trial sql server on a hosting site that to find the cause of the problem...