Cannot connect to my local instance When I connect to my local server, I get this message 

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:   
Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft   
SQL Server, Error: 2)


This is my login information:

Server type :       Database Engine
Server name :       .
Authentication:     SQL Server Authentication
Login:              sa
Password:           123


How can I fix it?
Go to SQL Server Configuration Manager

Start->all program->SQL Server 2008 R2->Configuration Tools->SQL Server Configuration Manager 

Explore "SQL Server Network Configuration" and then select "Protocols For MSSQLSERVER".

Check your TCP/IP Protocols in right side pane. If it is disabled then enabled it and Restart the "Sql Server(MSSQLSERVER) service" that available in  "SQL Server 2008 R2 services pane".

You can follow the same steps to make sure for other protocols and services.