When running a .NET 3.5 web app (C# code behind) on my local machine, I encounter error 26 "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 have followed the steps at http://blogs.msdn.com/b/sql_protocols/archive/2007/05/13/sql-network-interfaces-error-26-error-locating-server-instance-specified.aspx and it is worth noting that connections are successfully made to the database at many points in the code until it reaches a few specific points, such as:
_prod = ProductBL.GetInstance().doGetDetail(_prod.prodId);
and
list.DataSource = BrandBL.GetInstance().doGet();
and
DataTable myTable = AttributeBL.GetInstance().doGet();
I do not encounter these problems when the code runs on the production server.
The common theme with the problem here appears to be these *BL libraries (and the .GetInstance() methods) which are compiled dlls. Obviously I have the option of rewriting this code, but why should this make the SQL connection time out on my local machine and not on the production server?