During trying to access database server through LAN, there are many things mess up.
- Wrong userId and password
- Ping interval breaking
- System is shutdown etc
To resolve this issue, make sure your following steps are in working condition correctly
- Database Engine is configured correctly to accept remote connections
Make sure your database engine is configured to accept remote connections. To Enable remote connections do following things.
- Start > All Programs > SQL Server 2005 > Configuration Tools > SQL Server Surface Area Configuration
- Click on Surface Area Configuration for Services and Connections
- Select the instance that is having a problem > Database Engine > Remote Connections
- Enable local and remote connections
- Restart instance
- SQL Server Service account
If you are not using a domain account as a service account and you are using NETWORK SERVICE, you may want to switch this first before proceeding.
- SQL Server Instance
If you are using a named SQL Server instance, make sure you are using that instance name in your connection strings in your application. Usually the format needed to specify the database server is machinename\instancename. Check your connection string as well
- Firewall Exception
You may need to create an exception on the firewall for the SQL Server instance and port you are using:
- Start > Run > Firewall.cpl
- Click on exceptions tab
- Add the sqlservr.exe (typically located in C:\Program Files (x86)\Microsoft SQL Server\MSSQL.x\MSSQL\Binn, check your installs for the actual folder path), and port (default is 1433)
- Check your connection string as well
Also you may also need to create an exception in your firewall for SQL Browser.