Bonjour, en fait j'ai ca comme connection string et code d'insertion, et je voulait savoir comment mettre cette chaine de connection dans la module pour ne plus l'ecrire dans chaque feuille.
Comment je peux faire?
------------------->
Public objConnection As New SqlConnection("Data Source=JONATHAN-PC;Initial Catalog=etudiant;integrated security=SSPI")
Dim objCommand As SqlCommand = New SqlCommand()
objCommand.Connection = objConnection
objCommand.CommandText = "INSERT INTO Etud(nom)
VALUES(@nom)"
objCommand.Parameters.AddWithValue("@nom", txtnom.Text)
objConnection.Open()
objCommand.ExecuteNonQuery()
objConnection.Close()
MsgBox("Values saved !")
txtnom.ResetText()
Merci,
Sengi Jonathan