how do i do this:-

The dyndns that allows Admin to get result from different location.
No need to get the database over from another location, able to view the report and print.

Using VB.net and SQL Server 2008

5 Years
Discussion Span
Last Post by dxider

Sorry that i didnt explain much. I have created a Survey System for Driving Schools. What they require is, when the student does the survey the data can be viewed by the Admin to see what the students have answered according to Categories. This is to monitor the Instructor, Customer Service and Tranportation KPI. So they want this system to be centralized, For example the Admin from School A Located at Location A can view and print the report from School B Located at Location B, vice versa. Anything else you need me to explain?


So ur trying to develop a program to connect to several location using the dyndns software?


Hi, i have already developed it, but i just dont know how to connect using dyndns, in order for the Admin to get results from different location. For example: my interface has got few buttons of Location Name such as Permas Jaya,Kulai,Johor Jaya. So when the admin from permas jaya click's Kulai it should fetch the data from the server in Kulai and display it.


Dyndns provides you with a name for the site instead of the IP address. you have to change the connection string when u change the request to another database. For example

Kulai dyndns: kulay.dyndns.com
Jaya dyndns: jaya.dyndns.com

So u only need to change the conection string when you select another location to point the the selected database, Something like this:


Dont forget to open SQL server ports to allow remote connections to your database.
I hope this is the kind of answer you are searching for.


So do i write this connection strings at the buttons? I have already created a ConnectDB with the connection string, but do i sepcify multiple connection string in order for it to fetch the particular data?


Yes, you need to change connection string to fetch data from another server. Are you connecting to database with plain code or using a ui feature?.


With plain code i mean something like this:

dim con as new sqlconnection("Server=kulay.dyndns.com;Database=myDataBase;Trusted_Connection=True;")
dim com as sqlcommand=nothing
com=new sqlcommand("select * from surveys",con)
dim datar as sqldatareader=com.executenonquery
while datar.read
' code to handle data
msgbox datar.item(0) & " - " & datar.item(1)
end while

If you program the solution with the provided code, you just have to add a conditional statement to choose which connection string should be used, store it into a variable and replace the string used in the creation of the object "con". Something like this.

dim conString as string = string.empty
select case cmbLocation.selecteditem
  case "Jaya"
  case "Kulai"
end select
dim con as sqlconnection=new sqlconnection(conString)

' remaining code to use data
This article has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.