c# - Handling being online and offline -


I have an application that calls an online database if I lose connection to the Internet or the database is closed My application will crash if it goes.

What is the way to handle this?

My own approach is an object, calling the database all the time and if an exception is thrown, then an event is removed which registers all other components and then some functions are disabled. Are there.

Is this the right way or better solution?

It is difficult to say that what would be best for you to know the bigger picture, but I have 3 ways Think that you can potentially put these situations in hand:

1) Timely handles connectivity issues well and just report them well
2) Like You say, from time to time voting connectivity and disabled functionality if "ping" fails.
3) Work with local copy of BB, then when you have connectivity, make updates synchronously to main DB at one time

IMO, I will go 1) or 3) Option 3 best user experience Option 1 potentially involves at least God's efforts.

With Option 2, you have a problem, no matter how many times you vote, you can influence the connectivity problem at any time.


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -