2013-08-07 327 views
1

我有连接字符串,但它不起作用。为什么?SQL Server连接字符串

错误:

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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

连接字符串:

<add name="CompanyEventConnectionString" 
    connectionString="database=db;server=PETLITSKY-R\SQLEXP;user id=sas; [email protected]; MultipleActiveResultSets=True;" /> 
+1

我不知道我们可以告诉只是来自字符串。你能通过一些本地SQL客户端手动连接到这个数据库吗? –

+0

您是否确实安装了SQL Server ** Express **并明确选择调用您的实例SQLEXP?如果您有Express,但默认安装 - 使用'PETLITSKY-R \ SQLEXPRESS'作为服务器名称 –

回答

0
<add name="ConString" connectionString="Data Source=.;InitialCatalog=ServerMaintenance;User Id=sa;Password=something;" />