2013-06-20 27 views
2

當我從構建服務器的Visual Studio運行Web服務時,我能夠運行服務並訪問數據庫。與服務器建立了連接,但在登錄前發生錯誤

但是,當我在iis 7.5上託管Web服務時,我能夠運行Web服務,但我無法訪問數據庫。我收到以下錯誤。

A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: SSL Provider, error: 0 - The certificate chain was issued by an authority that is not trusted.)

我沒有任何線索如何解決這個問題。請在這方面幫助我。

回答

0

此錯誤安裝而改變你的計算機的Internet協議設置程序後發生。最近我在安裝互聯網下載管理器後遇到了同樣的問題,因爲IDM已經改變了IP設置,所以在我的PC上卸載IDM並重新啓動PC解決了這個問題後,出現了錯誤。 SO卸載任何已更改Internet協議設置的應用程序,如Internet下載管理器。

1

如果使用SMO那麼你可以做的跟隨代碼:

SqlConnectionInfo sci = new SqlConnectionInfo(); 
      sci.ConnectionProtocol = NetworkProtocol.NamedPipes; 
      sci.EncryptConnection = false; 

//設置EncryptConnection爲false,當您使用SQLServer的SMO,當屬性設置爲true的servercertificate的SQL服務器實例必須設置。

相關問題