Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个有多个 IP 的服务器,例如,默认是 10.1.1.2,第二个是 192.168.1.2
我必须连接到远程 SQL Server,但使用 192.168.1.2。
如何在 SqlClient 连接中设置本地 IP?
谢谢!
在您的属性中设置连接字符串:
Data Source=192.168.1.2;Initial Catalog=<databaseName>;uid=<userName>;pwd=<password>