1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| Sub saveCmdClient(ByVal idClient As Integer, ByVal dateJour As Date)
connexion = New SqlConnection(chaine)
Dim req As String = "insert into Commande(IdClient, DateCmd) values('" & idClient & "," & dateJour & "')"
Try
connexion.Open()
cmd = New SqlCommand(req)
cmd.Connection = connexion
cmd.CommandType = CommandType.Text
cmd.CommandText = req
Dim res As Integer = cmd.ExecuteNonQuery
If res > 0 Then
MsgBox("Enregistrer ", MsgBoxStyle.Information, "Rapport")
Else
MsgBox("Pas Enregistrer", MsgBoxStyle.Exclamation, "Rapport")
End If
'fermeture de la connexion
connexion.Close()
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Exclamation, "Rapport")
End Try
End Sub |
Partager