Connecting to server which located remotely throws timeout exception
In your manual procedure you state that you specify "name" in the server name, not an instance.

However in your connection string you specify

Data Source =tcp:&lt;IPAddress of RDP Machine&gt;\&lt;ServerName&gt;;


Which indicates &lt;servername&gt; should be used as an instance name.

You should probably remove \&lt;servername&gt; part of your connection string.

You should also verify the necessary ports are open on the firewall and make sure SQL Server is configured to allow remote connections as well as make sure tcp/ip is in the enabled protocols.

There is a decent MSDN blog post covering a lot of other steps you can take to troubleshoot your connectivity issues: Troubleshoot Connectivity/Login failures (18456 State x) with SQL Server