简体   繁体   中英

Can't connect to SQL Server using Trusted Connection from UWP-App

I'm trying to connect to a SQL Server from an UWP-App using Trusted_Connection=true in Connectionstring. Connection.Open fails with error 18452 (not associated with a trusted sql server connection). I can connect with SSMS using Windows-Authentication. Even from a .Net Core App the connection with the same connectionstring succeeds.

In UWP-Capabilities I've checked: Enterprise Authentication, Internet (Client&Server), Private Networks The Target version is Win10 version 1903, Min version is Win 10 Fall Creators Update

Here's a code snippet:

            using (SqlConnection c = new SqlConnection("Server=sql02;Database=Workdata_test_ad;Trusted_Connection=True"))
                await c.OpenAsync();

EDIT: connecting with explicit username and password works fine but is not the goal.

Try server name as '.' SqlConnection("Server=.;Database=pzdb01_test_ad;Trusted_Connection=True"))

Our development sql server runs on Ubuntu, to which I'm not able to connect. the production server runs on Windows, to which i can connect from UWP-App.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM