2012-06-26 43 views
1

當我嘗試訪問保存在「App_Data」文件夾中的MS-SQL數據庫時,出現問題。 在web.config文件我的連接字符串是 -如何訪問保存在App_Data文件夾中的數據庫

<add name="ConnectionString" connectionString="Data Source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\CRMDb.mdf;User Instance=true" providerName="System.Data.SqlClient"/> 

例外是 -

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)

任何相關的幫助將高度讚賞。 在此先感謝

回答

1

首先要做的事情是:您的計算機上是否安裝了SQL Express?如果沒有,你可以免費獲得here

如果您確實安裝了SQL Express,請檢查您的SQL Express實例是否正在運行。如果未運行,請打開命令提示符(as Administrator)並執行以下命令:

net start mssql$sqlexpress 
相關問題