SQL Connection with public IP, named instance and port number

后端 未结 4 1018
盖世英雄少女心
盖世英雄少女心 2020-12-16 19:15

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). Anyo

4条回答
  •  感动是毒
    2020-12-16 19:43

    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;
    

提交回复
热议问题