Hi,

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

can you explain a little bit better please

Explain better what you want to do.

Hi,
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.

I have done a simple flowchart. have attached.

Have attached a simply flowchart for better picture.

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:

Server=kulay.dyndns.com;Database=myDataBase;Trusted_Connection=True;
or
Server=jaya.dyndns.com;Database=myDataBase;Trusted_Connection=True;

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
con.open
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
datar.close
com.dispose
con.close
con.dispose

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"
      conString="Server=jaya.dyndns.com;Database=myDataBase;Trusted_Connection=True;"
  case "Kulai"
      conString="Server=kulay.dyndns.com;Database=myDataBase;Trusted_Connection=True;"
end select
dim con as sqlconnection=new sqlconnection(conString)

' remaining code to use data
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.