2013-08-07 384 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;" />