2012-05-21 126 views
0

連接字符串我有這樣的連接字符串爲默認的服務器名稱

<add name="ApplicationServices" connectionString="Data Source=local;Initial Catalog=mycatalog;Integrated Security=True" 
     providerName="System.Data.SqlClient"/> 

的問題是,我想local數據源是錯誤的,因爲我不斷收到此錯誤

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) 

應該是什麼正確的連接字符串?

+0

在SQL Server Management Studio中,右鍵單擊您的數據庫,然後單擊「查看連接屬性」,並驗證服務器名稱和其他變量是正確的,並匹配您的連接字符串 –

回答

1

使用

  • (本地)
  • 本地主機

這是正確的,只是一個./dot

添加各地的地方括號如果你喜歡的