If I understood you correctly, you install the SQL Server separately from the application setup.
If this is correct, your error message defines that the SQL Server is unavailable when you start the program. Some potential reasons:
- the sql server is not running
- workstation firewall is blocking requests
- your connection string isn't corrrect
- your credentials / user info is incorrect
For more reasons, see http://blog.sqlauthority.com/2009/05/21/sql-server-fix-error-provider-named-pipes-provider-error-40-could-not-open-a-connection-to-sql-server-microsoft-sql-server-error/