1

I am getting problem while I try to access MS-SQL database that is kept in "App_Data" folder. My connection string in web.config file is-

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

The Exception is-

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)

Any relevant help would be highly appreciated. Thanks in advance

1 Answer 1

1

First things first: do you have SQL Express installed on your machine? If not you can get it here for free.

If you do have SQL Express installed, check if your SQL Express instance is running. If it's not running, open a command prompt (as Administrator) and execute the following command:

net start mssql$sqlexpress
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.