簡體   English   中英

當我嘗試使用Windows Universal PlatformApp連接到SQL Server 2008R2時出現System.Data.SqlClient.SqlException

[英]System.Data.SqlClient.SqlException when I try to connect to SQL Server 2008R2 with a Windows Universal PlatformApp

嗨,當我嘗試從Windows Universal Platform App使用System.Data.SqlClient連接到Microsoft SQL Server 2008R2時,出現以下異常:

System.Data.SqlClient.SqlException:'已成功與服務器建立連接,但是在登錄過程中發生了錯誤。 (提供者:TCP提供程序,錯誤:0-操作成功完成)'

這是我的連接字符串,我正在使用SQL身份驗證:

string connectionString = "{Data Source=xxx.xxx.xxx.xxx; Initial Catalog=TheDatabase;Integrated Security=false;User ID=user;Password=Password}"

當我嘗試連接到2016 SQL Server時,一切正常,這是我的代碼:

using (SqlConnection connection= new SqlConnection(connectionString))
    {
        connection.Open();
    }

在connection.Open()處引發了異常

注意事項:

  • 我已經在Package.appxmanifest中設置了所有必需的權限(enterpriseAuthentication,privateNetworkClientServer)
  • SQL Server同時具有Windows和SQL身份驗證,並啟用了TCP
  • 該軟件包的目標版本是Windows 10 Fall Creators Update(10.0; Bulid 16299)
  • 我已經嘗試過Integrated Security = true,並且例外是相同的
  • 其他應用程序(非WUP)可以與2008R2 Server一起正常運行,也可以與帶有.NET的C#應用​​程序一起使用

該線程提出了同樣的問題: 鏈接到問題

SQL Server 2008R2的Service Pack 3可以幫助嗎?

是否有變通辦法或更好的方法來使2008R2與WUP一起使用?

安裝2008R2 Service Pack解決了該問題。 我嘗試使用2008R2 Express在本地PC上重現該問題。 我重現了該問題,並在對2008R2 Service Pack 2 Express進行了更新之后,一切正常進行。

我將在生產環境中安裝Service Pack 3,並在運行時對其進行更新

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM