The following error message was displayed when trying to attach to a database file (.mdf included the .ldf file) in visual studio.  We are using Visual Studio 2010 (pro or above)  and SQL Express 2008. 
“A network-related or instance-specific error occurred while establishing a connection to SQL server.   The server was not found or not accessible.  Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL network Interface, error: 26 &ndas ...

Go to the complete details ...