默认服务器名称的连接字符串

时间:2012-05-21 13:10:39

标签: sql-server-2008 connection-string

我有这个连接字符串

<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)

什么是正确的连接字符串?

1 个答案:

答案 0 :(得分:1)

使用

  • (本地)
  • 本地主机

这是对的,只是一个./dot

如果您愿意,可以在本地附近添加括号