handling connection failure?

Xray

New member
Joined
May 4, 2005
Messages
2
Programming Experience
Beginner
I like to find a solution when there is a connection error between client and server (network failure?) the application waits until the connection is back online and then continues with reading, saving...

In the meantime the user gets a warning/waiting screen thats there is a problem and he have the option to wait until the connection is back ok
(or close the application but with not saving).

Im working with vb .net
and ms sql server.
 
datasets can be read/written from/to disk using ReadXml/WriteXml for overnight persistence. Other than that.. just handle excpetions thrown during save.

Given that the .NET 2.0 ways of doing things include automatic connection opening and closing, you dont really need to look for the db coming back.. it will just start working again when the connection is back up
 
In a timer, use some code to ping the server every "x" milliseconds. If it can't ping the server, stop whatever is going on; if it can ping the server, do nothing.

I'm doing something similar. My client machines need information updates at a certain time each day. For awhile, my client side application would crash because I ignored the fact that it might lose connection; oops! I have since then fixed the problem and have it ping my server, get data then carry on as normal; being that ping was successful. What a life saver ;)

I'm now going to make it alert me every time a system on the network loses connection.
 
Back
Top