Below are the steps which I follow while connecting manually:
- Connect to VPN
- RDP to the remote machine using my credentials
- Open SQL Server Management Studio
- Connect to Server > database engine, Server Name > "Name", Authentication > Windows Authentication
- Run query
And the connection string that I am using is:
ConnectionString = "Data Source =tcp:<IPAddress of RDP Machine>\<ServerName>; Initial Catalog =<DBName>; User Id = <Username>; Password = <Password>; Trusted_Connection = True; Integrated Security = SSPI; Connect Timeout = 30; Encrypt = False; TrustServerCertificate = False"