If you face a problem while connecting to remote sql server please make sure below configurations are done

1. Enable the "Named Pipes"--> Go to  SQL Server Configuration Manager-->SQL Server Network Configuration-->Protocals for "sqlserver"

An exception of type System.Data.SqlClient.SqlException was thrown. Additional exception information: A network-related or instance-specific error occ

2. Specify TCP Port

An exception of type System.Data.SqlClient.SqlException was thrown. Additional exception information: A network-related or instance-specific error occ