1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| Public Sub InsertNouvClient(ByVal Nom As SqlTypes.SqlString, ByVal Prenom As SqlTypes.SqlString, ByVal adresse1 As SqlTypes.SqlString, ByVal adresse2 As SqlTypes.SqlString, ByVal cp As SqlTypes.SqlString, ByVal ville As SqlTypes.SqlString, ByVal tel1 As SqlTypes.SqlString, ByVal tel2 As SqlTypes.SqlString)
Dim sqlcnx As New SqlConnection()
Dim requete As String
sqlcnx.ConnectionString = Principale.Connexion
requete = "INSERT INTO CLIENT(Nom_Client,Prenom_Client,Adresse_1,Adresse_2,CP,Ville,Telephone_Fixe,Telephone_Portable) VALUES ('" + Nom + "','" + Prenom + "','" + adresse1 + "','" + adresse2 + "','" + cp + "','" + ville + "','" + tel1 + "','" + tel2 + "');"
Dim cmd As New SqlCommand(requete, sqlcnx)
cmd.Connection.Open()
cmd.ExecuteNonQuery()
cmd.Connection.Close()
MsgBox("Le client a été ajouté avec succès !", MsgBoxStyle.Information)
cmd = Nothing
End Sub |
Partager