As far i am concerned the error means that "It is not allowing remote connections"
So i think the solution is if you are using Express edition
Go to the Configuration Manager and open it.
After openeing there will be two attributes by name SQL Server(Browser),SQL Server
right click on it and click Stop and restart both of the services
Then check the properties part and everything works fine or not
Let me know if this helps you
http://blogs.msdn.com/sql_protocols/archive/2005/10/22/sql-server-2005-connectivity-issue-troubleshoot-part-i.aspx
Have a look at the following KB article, it will take you through the process of allowing remote connections.
How to configure SQL Server 2005 to allow remote conections
http://support.microsoft.com/default.aspx?scid=kb;EN-US;914277
http://blogs.msdn.com/sql_protocols/archive/2007/03/31/named-pipes-provider-error-40-could-not-open-a-connection-to-sql-server.aspx
http://blogs.msdn.com/sql_protocols/archive/2007/05/13/sql-network-interfaces-error-26-error-locating-server-instance-specified.aspx