views:

106

answers:

4

I have a login page that works in my local development environment. When I push the site onto the web server, i am getting this error when trying to login from the asp.net login control.

An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

I cannot figure out why it does not work on the server. Do I need to add anything or change something in the web.config?

+2  A: 

This support article may help. It may also be a firewall issue or an authentication issue on the new setup (but the error message makes that less likely).

JP Alioto
A: 

Check to make sure TCP/IP is enabled on the SQL Server. For whatever reason, named pipes and TCP/IP is off by default. Also make sure you are trying to connect to the correct instance (maybe you are using ./SQLEXPRESS locally and on the server SQL is installed on the default instance). Lastly, make sure the database you are trying to connect to exists on the server.

sestocker
I am using the aspnetdb.mdf instance inside of app_Data and the local connection ./SQLEXPRESS. Should this be changed?
I've tried checking the TCP/IP, but it is turned on. I can't seem to figure out what the problem may be.
A: 

It has something to do with my laptop. Only thing that I can think of is the built in windows firewall. I disabled the windows firewall but am still having the same issue. Can anybody think of any other local processes that could cause this issue?

FALCONSEYE
+1  A: 

For resolving error 26 in sql server you need to do the following steps.

At Server System 1. Under surface area configuration manager-Open up remote connections. 2. Add into firewall 1433 and 1434 port no as n exception. 3. Open port 1433 on router for WAN access. 4. Add client machine ip address as an exception to your antivirus or allow LAN settings in antivirus. 5. Now try to check if both client and server are connected to each other. for this type "ping IP address of remote system" at run and if reply is obtained then do same for server machine. If reply is obtained from both machines.

Open Sql server and try to connect to remote machine which allow remote connections using its ip address. U will surely get connected to server machine

See this video

Shantanu Gupta