No connection could be made because the target machine actively refused it

You may get this error while trying to establish a connection to a SQL Server database remotely. Here are a few things you should check.

By default, SQL Server uses port number 1433. To create a connection string over firewall with the IP and port number, use the following format:

<add name="connection" connectionString="Data Source=[YOURIP XX.XX.XX.XX],1433;Network Library=DBMSSOCN;Initial Catalog=[YOURDBNAME];User ID=[YOURUSERID];Password=[YOURPASSWORD]"/>

You need to make sure you replace variables in this connection string with correct values.