繁体   English   中英

无法使用来自 UWP-App 的可信连接连接到 SQL Server

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

我正在尝试使用 Connectionstring 中的Trusted_Connection=true从 UWP 应用程序连接到 SQL Server。 Connection.Open 失败并出现错误 18452(与受信任的 sql server 连接无关)。 我可以使用 Windows 身份验证与 SSMS 连接。 即使来自 .Net Core App,具有相同连接字符串的连接也会成功。

在 UWP-Capabilities 我检查过: Enterprise Authentication, Internet (Client&Server), Private Networks目标版本是 Win10 版本 1903,最低版本是 Win 10 Fall Creators Update

这是一个代码片段:

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

编辑:使用显式用户名和密码连接工作正常,但不是目标。

尝试将服务器名称设为“.” SqlConnection("Server=.;Database=pzdb01_test_ad;Trusted_Connection=True"))

我们的开发 sql 服务器在 Ubuntu 上运行,我无法连接到它。 生产服务器在 Windows 上运行,我可以从 UWP-App 连接到它。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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