Cannot establish the connection to sql

Sometimes when you try to ligin to Sitecore, you will get this error:
There might be several reasons but first check if you can connect to your local DB directly in SQL management.

  1. open your config file to see the connection string
    (it should be somewhere like wwwroot\Website\App_Config\ConnectionStrings.config
  2. Then try to connect in sql management. It it failed then check the Services to see if SQL is runnning at all.
    Open the window services and find SQL service:
  3. Start the SQL service if it is not already.
  4. Then try connecting to your DB again. It should be fine