0
votes

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)

Anyone can help me with this? I am using SQL Management Studio 2012. I already tried opening sql server manager but I dont see any SQLEXPRESS server in there. Im just using localdb. Sorry guys im just a newbie in web development.

This is my connection string

add name="MyCon2"
connectionString="Server=Villar-PC\Justin;Database=DBNAME; Integrated Security=true;>
1

1 Answers

1
votes

Run services.msc and check sql server (or express depending on what you have) service. It should be running. If not, start it and check.

Also check if the database you are mentioning exists

Edit: If you are using sql localdb, you can refer to http://www.asp.net/mvc/overview/getting-started/introduction/creating-a-connection-string for the connection string

<add name="MovieDBContext" 
   connectionString="Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\Movies.mdf;Integrated Security=True" 
   providerName="System.Data.SqlClient" 
/>