0

I am building a web site using ASP.NET C# in Visual studio 2012. When adding login control to form and running the website to test it , it gave me an error that it can't connect to server. this is the error message

(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) )

I tried it on another machine which have both( SQL server 2008 R2 & Visual studio 2012 ) installed , but it still gives me the same error. Any idea about this?

meda
  • 45,103
  • 14
  • 92
  • 122
AhdDbn
  • 121
  • 1
  • 2
  • 7

1 Answers1

0

The error said application cannot connect to SQL server.

Could you able to connect SQL Server from Server Explorer using same credential?

If not, there are multiple posts in SO regarding how to configure SQL Server to allow remote connections.

enter image description here

Win
  • 61,100
  • 13
  • 102
  • 181
  • I tried to connect to SQL Server from Server explorer as you said but it couldn't find the server – AhdDbn Feb 04 '14 at 20:15
  • You've said it all. SQL Server doesn't exist, or doesn't allow remote connection. – Win Feb 04 '14 at 20:24
  • I checked my SQL Server, it's configured to allow remote connections. – AhdDbn Feb 04 '14 at 20:30
  • Look at [this](http://stackoverflow.com/a/12043802/296861) and [this](http://stackoverflow.com/a/11376350/296861) – Win Feb 04 '14 at 21:22