I haven't logged in my Sql Express application for a week now because I've been in the Foundation Class offered by PragmaticWorks. When I decided to log in tonight I received the error that you see below:
Cannot connect to TECH-PC\SQLEXPRESS.
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) (Microsoft SQL Server, Error: -1)
Goto your start menu > All Programs > Microsoft SQL Server 2008 R2 > Configuration Tools > SQL Server Configuration Manager
When I opened up Sql Server Configuration Manager I get a split window. To the window on the Right I have three options:
SQL Server Browser
SQL Server (SQLEXPRESS)
SQL Server Agent (SQLEXPRESS)
Look at the "state" of all three items in this view. If all three say "stopped" then right click on SQL Server (SQLEXPRESS) and click "START".
This fixed my problem and allowed me to connect to the database. Not sure why it wasn't running automatically. Or if there is a permanent fix but I got lucky and stumbled on this! Hope this helps someone else.