Last active
August 24, 2017 14:10
-
-
Save fredgdaley2/08626d78604717c5bd7df3edf92b6191 to your computer and use it in GitHub Desktop.
Check if an MySQL server is alive.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Imports MySql.Data.MySqlClient | |
Public Function IsMySqlServerAvailable(ByVal dbCnxStr As String) As Boolean | |
Try | |
Using srvrConnection = New MySqlConnection(dbCnxStr) | |
Try | |
srvrConnection.Open() | |
Return True | |
Catch ex As MySqlException | |
Return False | |
End Try | |
End Using | |
Catch ex as ArgumentException | |
Return False; | |
End Try | |
End Function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment