Results 1 to 6 of 6

Thread: Connect 2 PC through internet

  1. #1

    Thread Starter
    Fanatic Member manhit45's Avatar
    Join Date
    May 2009
    Location
    Ha noi - Viet Nam
    Posts
    826

    Connect 2 PC through internet

    Hi every one, i have connected 2 computer via lan (using sql server)
    But i want I Can access to other PC through Internet using sql server, Namely i want to access database sql on that PC. I REAd Some document about that but i am wonder , and i dont see very clearly. Can i use VPN to connect via internet or other tool ???

    --***----------***-----

    If i help you please rate me.

    Working with Excel * Working with String * Working with Database * Working with array *

    K51 ĐH BÁCH KHOA HÀ NỘI - Khoa CNTT pro.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Connect 2 PC through internet

    If you use a VPN then you're on the same network, so it's as though they were both connected to the same router. If you actually want to connect over the internet then that's a configuration option in SQL Server. Connecting from VB is exactly the same as any connection; you just edit the connection string. The alternative would be a web service on the same network as the SQL Server and your app invokes that to get and save data.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Fanatic Member manhit45's Avatar
    Join Date
    May 2009
    Location
    Ha noi - Viet Nam
    Posts
    826

    Wink Re: Connect 2 PC through internet

    Have you got any example about that. ex : How can you access to database on my machine if i allow. Guid me please. I NEED it very much.
    --***----------***-----

    If i help you please rate me.

    Working with Excel * Working with String * Working with Database * Working with array *

    K51 ĐH BÁCH KHOA HÀ NỘI - Khoa CNTT pro.

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Connect 2 PC through internet

    As I said, connecting to a database is ALWAYS the same in VB. You simply change the connection string. If you don't know the appropriate connection string then you should visit www.connectionstrings.com. How to configure a SQL Server to allow connections from the internet is not a VB.NET issue so, if you want further help on that, you should post in the Database Development forum.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367

    Re: Connect 2 PC through internet

    Also if you are behind a router or firewall, you will need to forward a port (usually 1433) to the SQL Server machine:

    http://support.microsoft.com/kb/287932

  6. #6

    Thread Starter
    Fanatic Member manhit45's Avatar
    Join Date
    May 2009
    Location
    Ha noi - Viet Nam
    Posts
    826

    Re: Connect 2 PC through internet

    Quote Originally Posted by jmcilhinney View Post
    As I said, connecting to a database is ALWAYS the same in VB. You simply change the connection string. If you don't know the appropriate connection string then you should visit www.connectionstrings.com. How to configure a SQL Server to allow connections from the internet is not a VB.NET issue so, if you want further help on that, you should post in the Database Development forum.
    I tried go to that link. But i wont access success. OK.
    I ll try now again. You mean. IF i want to connect to a machine which have IP address is 190.190.200.100 then i should have edit to : is it ?

    Code:
    Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=myDataBase;User ID=myUsername;Password=myPassword;
    --***----------***-----

    If i help you please rate me.

    Working with Excel * Working with String * Working with Database * Working with array *

    K51 ĐH BÁCH KHOA HÀ NỘI - Khoa CNTT pro.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width