Reputation: 313
I am trying to connect to a database on another network through a vpn. How do I set up the connection string? There is a network password to get on the network and then a database password to connect. Is there a way to set this up?
<connectionStrings>
<add name="remoteDB" connectionString="eng=INV;Links=tcpip(Host=xxx.xxx.xx.xx,xxxx);uid=userid;pwd=password"/>
</connectionStrings>
Upvotes: 3
Views: 2445
Reputation: 45771
There's no, standard, way to define VPN connection settings as part of your connection string. There may be a way with the specific database provider you're using (as what you have in your sample doesn't look much like SqlServer), but you'd need to either clarify what that is incase someone knows, or refer to the documentation for it.
The connection to a VPN is normally establised either by the Operating System or by a 3rd party piece of software such as the Cisco VPN Client and thus is entirely transparent to the software that's connecting to the database. If you want to be able to establish the VPN connection prior to the database connection, programatically, that's a different matter entirely.
Upvotes: 1