1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| Imports MySql.Data
Imports MySql.Data.MySqlClient
Public Class Form2
'connexion a la base'
Dim Connexion As New MySqlConnection("Server=localhost ; DataBase=authentification;User=root ;Password= ;")
'verification de la connexion'
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Try
Connexion.Open()
Catch ex As Exception
MsgBox("une erreur s'est produite")
End Try
If Connexion.State = ConnectionState.Open Then
MsgBox("Connexion REUSSIT!!!")
End If
End Sub
End Class |
Partager