0

I have a sample VB.NET App that successfully connects to my remote sql server for checking license status. My table name is

"Register"

ID ------  Name -------- CPUSerial
1 --------   john  ----------BEER123456

When debugging my application, I clicked on the button and the data was correctly loaded into a DataGridView.

However, When my Internet connection is down or when I disabled network adaptor, my application freezes and throws error 40.

I would like an example (database connection code example) that keeps silently connecting to remote server for checking specific record or use other threads that will not cause app freezing. Application must keep running whether the Internet connection is lost or not. Something like:

Timer1_Tick Event (Interval = 10000 ms)
If database connection string = unreached Then
  MsgBox("Check Your Internet Connection")  
  and User Will Press OK Then
  Application Keep Running
Else
  Nothing Show Any Message
End If
Tunaki
  • 132,869
  • 46
  • 340
  • 423
Super
  • 11
  • 3
  • 1
    Why don't you catch the exception when the connection breaks? Then try to connect again.... – Grantly Jan 02 '16 at 20:18
  • A lot of [possible options here](http://stackoverflow.com/questions/2031824/what-is-the-best-way-to-check-for-internet-connectivity-using-net) to check if you have an internet connection available – Steve Jan 02 '16 at 20:18
  • Thank You For Answering ... Grantly and Steve .. Now I've idea from your answer .. :) – Super Jan 02 '16 at 20:27

0 Answers0