Connect to SQL Server through IP address

前端 未结 2 1333
走了就别回头了
走了就别回头了 2020-12-03 19:27

I\'m developing tools using vb.net framework 4, and I need to connect to company server through IP address, so staff will be able to use the apps from home.

I have t

2条回答
  •  孤城傲影
    2020-12-03 20:34

    Right idea, you just overelaborated.

    If the SQL Server is the default instance on that computer, you can just specify it as:

    Data Source=xxx.xxx.xxx.xxx
    

    If it's a named instance, specify it as

    Data Source=xxx.xxx.xxx.xxx\INSTANCENAME
    

    For SQL Express instances, it is generally:

    Data Source=xxx.xxx.xxx.xxx\SQLEXPRESS
    

    If there're multiple instances running on the same server, you may need to leave the SQL Browser Service running (it is generally disabled by default).

    There is a fantastic web resource out there at http://www.connectionstrings.com. They provide the syntax and options for connecting to just about any kind of server database that's out there.

    Also, when working through SQL connectivity problems, it's always helpful to turn off your firewall on the server machine until you have everything worked out, and then re-enable it and work through the firewall issues afterwards. It just makes life more difficult when you're trying to address multiple potential issues all at once.

提交回复
热议问题