我是一個Asp.Net初學者,我正嘗試創建一個基於Web的應用程序。當我將ASP.Net與SQL Server 2005連接時,它會在執行應用程序時顯示以下錯誤。無法在SQL Server 2005與asp.Net之間建立連接
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
儘管我嘗試了足夠的嘗試,但無法獲得解決方案,現在我需要您的幫助來解決這個問題。
在此先感謝。
更新:這裏是我的連接字符串從web.config
:
<add name="cn"
connectionString="DataSource=PT-7DBE27DA8;InitialCatalog=Pages;IntegratedSecurity=True"
providerName="System.Data.SqlClient"/>
發佈您的連接字符串將幫助我們來幫助你。 – TheGeekYouNeed 2012-01-08 12:28:49
@TheGeekYouNeed true,Anshdeep - 只要確保從該字符串中刪除任何密碼或敏感的東西。我們只需要看看你如何嘗試連接。 – 2012-01-08 12:33:26
檢查您的連接字符串與http://connectionstrings.com上的示例 – Oded 2012-01-08 12:41:39