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

Leniel Maccaferri
  • 100,159
  • 46
  • 371
  • 480
ajay
  • 11
  • 2

1 Answers1

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
Leniel Maccaferri
  • 100,159
  • 46
  • 371
  • 480