Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
ADO.NET For discussion about ADO.NET.  Topics such as question regarding the System.Data namespace are appropriate.  Questions specific to a particular application should be posted in a forum specific to the application .
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ADO.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old June 22nd, 2007, 03:31 AM
Registered User
Join Date: Jun 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Building a connectionstring to a remote computer

In practically all the books i have about visual basic 2005 databases,all examples speaks about a database that exists on a local server. But what about a database that is on a server on a remote computer that is only reachable via the internet. For example:
I have a database that exists on the sql server 2005 on my desktop.
This desktop is connected to the internet. I have a laptop on wich i have my ADO.NET database program (in vb 2005). This laptop has a wireless connection with the internet. Now i like to connect from my laptop to the database on my desktop via the internet. The problem is that the IP address of my desktop is a dynamic IP address. How do i have to construct my connectionstring ? I heard about a program that solves the problem of dynamic IP addresses. Is it possible to use this program in relation to my ADO.NET program, and how do I put the address to my database on the server on my desktop in the connectionstring ?

Old June 22nd, 2007, 11:54 AM
planoie's Avatar
Friend of Wrox
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts

There are dynamic DNS services that will change a url to the dynamic IP automatically. You then can just set the "server" of your connection string to the domain and as long as the IP stays up-to-date it will work.

Depending on what your connection is at home (cable/dsl) you may have a much more statis IP than you think. I have a cable modem which does have a dynamic IP but I have my domain pointed at it and it very seldom changes. Typically, if the modem is connected all the time it won't change IPs. Usually I'll see it change when I turn it off for more than a few minues. It has mainted the IP thru restarts, short power outages, etc.

(Please note this disclaimer: Depending on your agreement with your ISP you might be violating your service contract by running a server or server-like services [i.e. database] on your connection.)

You do need to expose your server at home thru your internet connection.

If your computer is connected directly than you don't need to change anything with the hardware but you will likely need to change your OS firewall settings to allow requests for SQL server to come in.

If you have a router on your connection then you need to open the SQL port to point to your desktop at home. You'll have to refer to your router instructions for details.

The standard SQL server port is 1433. Just keep in mind that you are opening your database server to the world so make sure you have very string passwords for the accounts (most importantly the SA account).

Old June 29th, 2007, 07:03 AM
Friend of Wrox
Join Date: Oct 2004
Posts: 224
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to ashu_from_india Send a message via Yahoo to ashu_from_india

generally u use Public IP Address whn u want to host a remote server over the internet
try tht

Similar Threads
Thread Thread Starter Forum Replies Last Post
where to put my connectionstring pascali70 C# 10 June 22nd, 2007 05:09 AM
the ConnectionString Property... coolb C# 3 September 26th, 2006 02:05 AM
Windows Service can't access remote computer ADMystery General .NET 0 September 25th, 2006 03:56 AM
How you run a program in another computer (remote) Maritza Beginning VB 6 1 November 25th, 2005 01:51 AM
The ConnectionString property...! rajesh0363 All Other Wrox Books 2 July 26th, 2005 01:55 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.