1
votes

enter image description here

When I try to login to my website, an error occurs. I tried with run the SQL Service too.

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)

Connection string

Data Source=.\SQLEXPRESS (metro);Initial Catalog=metrodb;Integrated Security=True
1
Can you please post your connection string you're using? The error basically says there's something wrong with that connection string .....marc_s
i have updated my question with the connection string.maddy

1 Answers

1
votes

Based on your connection string, you're trying to connect to a SQL Server Express instance which is called SQLEXPRESS (metro) - is that really the actual name of your instance??

Typically, if you don't change any defaults, it's just SQLEXPRESS and thus your connection string should be

Data Source=.\SQLEXPRESS;Initial Catalog=metrodb;Integrated Security=True

You can see what SQL Server instances you have (and what they are called) when you go to Start > Microsoft SQL Server > SQL Server xxxx > Configuration Tools > SQL Server Configuration Manager - you'll see something like this:

enter image description here

You should see at least one SQL Server (instance name) service which is started - the name in brackets is your instance name (and MSSQLSERVER refers to the default, unnamed instance). So what does this show in your case??