具有公共IP,命名实例和端口号的SQL连接 [英] SQL Connection with public IP, named instance and port number

查看:66
本文介绍了具有公共IP,命名实例和端口号的SQL连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在用C#创建连接字符串时遇到困难,该字符串将使用公共IP,命名实例和端口号(不是1433)连接到远程SQL Server.有人知道该怎么做吗?

I have had difficulty creating a connection string in c# that will connect to a remote SQL server using a public IP, named instance and a port number (other than 1433). Anyone know how to do that?

推荐答案

尝试一下,用您要使用的端口号替换666,用您想要的IP地址替换190.190.200.100,等等:

Try this, replacing 666 with the port number you want to use, 190.190.200.100 with the IP address you want, etc.:

Data Source=190.190.200.100\MyInstance,666;Network Library=DBMSSOCN;Initial Catalog=myDataBase;User ID=myUsername;Password=myPassword;

这篇关于具有公共IP,命名实例和端口号的SQL连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆