locked
Connect to company SQL Server via IP RRS feed

  • Question

  • I am the app developer, working in VB.NET Framework environment. I need to connect to my company server, via some IP address, so the employees can use the apps from their homes

    Now, I have tried various types of connection string but I keep getting the error, telling me to check if instance name is correct and SQL Server is configured to allow remote connections. The error also says: (provider: TCP Provider, error: 0 - No
    connection could be made because the target machine actively refused it.)

    I’ve modified SQL Server settings, but it didn’t work neither. Any suggestions on resolving this issue will be much appreciated
    Monday, October 7, 2013 9:16 AM

Answers

  • Here is a web resource 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.

    • Some more things to help you out:
    •  Be sure to check if SQL Server is configured to listen on that IP address. To set this go to SQL Server Configuration
      Manager -> SQL Server Network Configuration -> Protocols for {instancename} -> TCP/IP -> IP addresses tab
    •  Here is some more info to help you with the firewall setting: http://www.howtogeek.com/112564/how-to-create-advanced-firewall-rules-in-the-windows-firewall/
    • You’ll need to enable TCP and UDP traffic on port 1433 for both incoming and outgoing traffic. If you have physical firewall or some other software firewall other than windows default you’ll have to contact your network admin
    Monday, October 7, 2013 9:24 AM

All replies

  • Hello Eric,

    How does your connection string look like? In common server + instance name is used to connect to a SQL Server, but you can use the IP address + port as well, for example to connect  to a local SQL Server with default port:

    Data Source=tcp:127.0.0.1, 1433

    So "tcp" as preset, then the IP address and at the end the port, separated by a coma.

    Have you also unblocked the used port for in & outbound in the Firewall on both side, server & all clients?


    Olaf Helper

    [ Blog] [ Xing] [ MVP]

    Monday, October 7, 2013 9:23 AM
  • Here is a web resource 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.

    • Some more things to help you out:
    •  Be sure to check if SQL Server is configured to listen on that IP address. To set this go to SQL Server Configuration
      Manager -> SQL Server Network Configuration -> Protocols for {instancename} -> TCP/IP -> IP addresses tab
    •  Here is some more info to help you with the firewall setting: http://www.howtogeek.com/112564/how-to-create-advanced-firewall-rules-in-the-windows-firewall/
    • You’ll need to enable TCP and UDP traffic on port 1433 for both incoming and outgoing traffic. If you have physical firewall or some other software firewall other than windows default you’ll have to contact your network admin
    Monday, October 7, 2013 9:24 AM
  • Assuming you are using SQL server 2012 

    Goto Programs

    • Microsoft SQL Server 2012  ----> Configuration Tools     --->   SQL Server Configuration Manager   a windows will      open , Click on SQL server Network Configuration and click on Protocols for the Server , Select TCP/IP and Right Click make sure it is Enabled and on IP  Address tab on same windows check the IP Address and Port and make sure it is enable and Active. 
    • click on SQL server Services on the left panel  then Select SQL server Browser on the right side and Right click and check the Long on Type.
    • Check your firewall settings and check  Port is not blocked.
    Monday, October 7, 2013 9:34 AM