SQL Server throws an exception 'Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. (Microsoft SQL Server, Error: -2) when try to connect from a remote computer. Most probable symptom for the error is TCP Port 1433 being blocked by the windows firewall in a computer running windows XP(SP2).
Make sure you have enabled remote connections from the SQL Server surface area configuration and allow TCP/IP, Named Pipe protocol or combination as necessary.
- To Enable Remote connections:  SQL Server 2005 –  Configuration Tools –  SQL Server Surface area configuration –  Click on 'Surface area configuration for services and connections'.
- Expand  Database Engine –  Remote Connections –  Select Local and remote connections –  Select the desired protocol (In this scenario I have used TCP/IP and Named Pipes)
- Restart the SQL Server.
Open TCP Port 1433 – This is the default port that SQL server use for remote connections. By default windows XP firewall deny access of this port:
- Open  Control Panel –  Windows Firewall –  Click on 'Add Port'
- Add: Name = SQL Server (Any meaningful name), Port Number = 1433 (by default, if you have changed the default port you have to make sure you enter the corresponding port number)