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 30 31
| maConnexionSQLsrv = New SqlConnection("ma chaine de connection")
maRequete = "INSERT INTO [PaimentEffectue] ( [id_Paiment],[Datepaiment],[RefPaiment],[MontantPai],[TransactionPaim]) VALUES (@id_Paiment, @Datepaiment, @Refpaiment, @MontantPai, @TransactionPaim)"
myCommand = New SqlCommand(maRequete, maConnexionSQLsrv)
With myCommand.Parameters
.Add(New SqlParameter("@id_Paiment", SqlDbType.UniqueIdentifier))
.Add(New SqlParameter("@Datepaiment", SqlDbType.Date))
.Add(New SqlParameter("@RefPaiment", SqlDbType.NChar, 10))
.Add(New SqlParameter("@MontantPai", SqlDbType.Money))
.Add(New SqlParameter("@TransactionPaim", SqlDbType.Money))
End With
With myCommand
.Parameters("@RefPaiment").Value = AutoScaleFactor
.Parameters("@RefPaiment").Value = Réf.Text
.Parameters("@Datepaiment").Value = DatePai.Text
.Parameters("@MontantPai").Value = Montant.Text
.Parameters("@TransactionPaim").Value = Note.Text
End With
Try
'Execution de la requête
myCommand.Connection.Open()
myCommand.ExecuteNonQuery()
myCommand.Connection.Close()
MsgBox("waw")
Catch ex As SqlException
MsgBox(ex.Message)
End Try |
Partager