0

I want to create my project shows message pop up ,when internet connection is slow, so i hope there is no data missed in my database , how i can solve my problem? i have try using this method

try {
}
catch (Exception err)
            {
                MessageBox.Show("Koneksi Error");
            }

but i think its not covered all my issue,

how i can solve this?

  • 2
    A solution is suggested [here](https://stackoverflow.com/questions/2031824/what-is-the-best-way-to-check-for-internet-connectivity-using-net) which requests google's generate_204 servlet. This will be a very fast call if connectivity is up, and will be slow or will fail (you can calculate the call duration) if it is down or very slow. – Oguz Ozgul Mar 31 '20 at 06:34
  • 3
    Step 1. Detect if the internet is down by making a test connection to a server that should be up (and potentially a fallback to be doubly sure). Step 2. Show a message. – ProgrammingLlama Mar 31 '20 at 06:38
  • A problem with checking the internet connection is nothing stops a good connection to suddenly slow down or break during the *actual* transfer. You should guard against the unreliable connection instead, with using transaction in database, confirming the result etc. – Martheen Apr 03 '20 at 03:04

0 Answers0