salut
j'ai fait mes imports
Imports System.Data.SqlClient
voila mon code pour conecter et inserer des données dans ma base de données

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
Dim ObjConnection As SqlConnection = New SqlConnection("Data Source=localhost;Initial Catalog=ifpwafcad;User Id ="";password=""")
 
        Label1.Text = "connexion ok"
 
        Dim ObjCommand As SqlCommand = New SqlCommand()
        ObjCommand.Connection = ObjConnection
        ObjCommand.CommandText = "INSERT INTO counselor VALUES(00010,'ala','aoulou','chab','00876456','ch@gmail.com')"
        ObjConnection.Open()
        ObjCommand.ExecuteNonQuery()
        ObjConnection.Close()
En fait j'ai mis
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
Dim ObjConnection As SqlConnection = New SqlConnection("Data Source=localhost;Initial Catalog=ifpwafcad;User Id ="";password=""")
Label1.Text = "connexion ok"
après une Try
et
Code : Sélectionner tout - Visualiser dans une fenêtre à part
Label1.Text = "connexion non réussie"
C bon
Mais lorsque je teste mon code la dessus
il m'indique que la fonction
ne marche pas
Est ce que quelqu'un peut m'aider
Merci