Look at the error 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)
It's pretty clear: it can't find the SQL server instance you are referring to.
Which means your connection string is wrong.
Ignoring that you shouldn;t hardcode connection strings, they should be in config files so you don't have to change the app each time you release it...
Start here:
Simple SQL Connection String Creation[
^] and make sure the connection works before you start to code!