Most of the times, developers get this annoying error message, see snapshot below:
One of the common reason for this error is when MSSQLServer instance is not running, go to
Start->Run->Services.msc and start the MSSQLServer Service as shown in the snapshot below:
And then refresh your SharePoint page, it starts working perfectly fine again.