0

I'm trying to connect to a remote server via VPN, and I have connected to the VPN successfully, and when I'm using management studio, it's also all good and well, but when I'm trying to connect via my WPF program I'm getting this error On connection.Open();

{"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: TCP Provider, error: 0 - The remote computer refused the network connection.)"}

and this is my Connection string as copied from visual studio

Data Source=192.168.232.10\PRI2014,4443;Integrated Security=True;User ID=c_Vision;Password=********;Connect Timeout=15; Encrypt=False; TrustServerCertificate=True; Trusted_Connection=True;

i have looked here and here for answers

styx
  • 1,852
  • 1
  • 11
  • 22

1 Answers1

0

Port number should be placed after Ip

  Data Source=192.168.232.10,4443\PRI2014;Integrated Security=True;User ID=c_Vision;Password=********;Connect Timeout=15; Encrypt=False; TrustServerCertificate=True; Trusted_Connection=True;
Serkan Arslan
  • 13,158
  • 4
  • 29
  • 44
  • Do you have any firewall on your client? A possibility that you have an restriction for your wpf application. Your firewall could only allow to management studio for using 4443 port. – Serkan Arslan Jan 30 '18 at 05:36
  • found the solution, there was a typo in the Connection string – styx Jan 30 '18 at 10:07