Hello
I'm trying to check if i have succsessfully make connection to both databases, but it always returns me false.
What i want to do is i have 2 databases : test1 test2
I want with the code to check if the information is correct and connects to both databases and if its ok show me result.
Public Function CheckMySqlConnectionAll() As Boolean
Try
Dim serverName As String = Data.Settings.MySQLServerHost
Dim userName As String = Data.Settings.MySQLServerUser
Dim port As String = Data.Settings.MySQLServerPort
Dim password As String = Data.Settings.MySQLServerPassword
Dim dbName As String = Data.Settings.AuthDatabase
Dim dbName2 As String = Data.Settings.WorldDatabase
Dim conStr As String = "server=" + serverName + ";user=" + userName + ";database=" + dbName + ";port=" + port + ";password=" + password + ";"
Using con = New MySqlConnection(conStr)
con.Open()
con.ChangeDatabase(dbName2)
con.Open()
Return True
End Using
Catch ex As Exception
Return False
End Try
End Function