Named Pipes Provider, error: 40 - Could not open a connection to SQL Server
Preliminary solution is just confirm if Sql Server service is started on your machine -
Note :- SQLServerManager12.msc is for Sql Server 2014 and SQLServerManager13.msc is for Sql Server 2016. You can change the version as per the Sql Server version installed on your PC.
If this is stopped then right click on it and click Start to run this service.