Help, iP addressing and message boxes

Mar 31 2010 4:49 AM

Hi Vb.Net heaven
Was wondering if you could help. I have two questions....
Question 1.
 Im looking to connnect to a server or an IP address. Thing is the ip/server address is on another network. How do i in code connect to that address.
On my form i have a text box that inputs the desired ip/server address but when a button on the form gets clicked it should test the connection, then connected me to that address so that if i would want access a database or a file i can do that.
Question 2.
On closing a form using the closing event i would like to use a message box to display the folling message.... "All data will be lost, please save all work before terminating this program"..... if the answer is YES then save to a database(northwind as an  example) and if the answer is NO then nothing happens. how do i do all this in code.
All work is done in VB 2008
Thanks your help in the matter will be much appreciated
Sunzah