none
connecting VB.net application to sql server remotely RRS feed

  • Question

  • Hello everyone,

    I want to connect to SQL server which is located at some fixed location through VB.net application online.The server is able to accessed when on same network through application.Do we have to use any VPN client or is there a way to do through VB.net? Please help me in this.

    Thanks


    Tuesday, October 31, 2017 7:23 AM

Answers

All replies

  • Can you be more specific in regards to 'fixed location'? If the database is online then it's a simple matter of the connection string.

    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Tuesday, October 31, 2017 10:49 AM
    Moderator
  • The most simple way is with an SQL Server standard connection. However, it needs of course that the user and password are known at the Server. 

    Be aware that simply creating one client for that spoils the security.

    https://www.connectionstrings.com/sqlconnection/standard-security/


    Success
    Cor

    Tuesday, October 31, 2017 11:12 AM
  • In regards to what Cor mentioned about security, here is one idea which encrypts and decrypts the connection string but this can be defeated by using say Fiddler to watch traffic.

    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Tuesday, October 31, 2017 11:45 AM
    Moderator
  • I want to connect to SQL server which is located at some fixed location through VB.net application online.The server is able to accessed when on same network through application.Do we have to use any VPN client or is there a way to do through VB.net? Please help me in this.

    One uses a VPN connection while using a Remote Desktop solution and run the program from a machine on the local network, remotely.

    Tuesday, October 31, 2017 12:35 PM
  • Hi dev.nets,

    Try the connection string:

    Data Source=ServerName/ServerIpAddress,1433;Network Library=DBMSSOCN;
    Initial Catalog=myDataBase;User ID=myUsername;Password=myPassword;

    Be Sure to Enable TCp/IP Enabled in SQl Server using Sql Configuration Manager and also enable Allow remote connection in you sql server using management studio,the following link is to enable Remote Connection and TCP/IP and Firewall protection

    https://blogs.msdn.microsoft.com/walzenbach/2010/04/14/how-to-enable-remote-connections-in-sql-server-2008/

    The link to Enable TCP/IP

    https://msdn.microsoft.com/en-us/library/bb909712(v=vs.90).aspx

    Best Regadrs,

    Cherry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by dev.nets Friday, November 3, 2017 5:21 PM
    Wednesday, November 1, 2017 6:48 AM
    Moderator
  • Thank you
    Friday, November 3, 2017 5:22 PM
  • Thank you

    You actually exposed MS SQL Server to remote access over the Internet? :) You can for sure expect it to be hacked along with every machine on the LAN!

    Friday, November 3, 2017 7:52 PM