I try to use a transaction to group several DB update together
But I have the following error message see attachment
Does anyone know what's wrong ???
Global_Data.CnPolitis.Open() 'Connector open
' 1- New transaction
Dim OleDbTrans As OleDbTransaction
Dim CmdOleDb As New OleDbCommand()
OleDbTrans = Global_Data.CnPolitis.BeginTransaction
CmdOleDb.Connection = Global_Data.CnPolitis
CmdOleDb.Transaction = OleDbTrans
Try
...
CmdOleDb = New OleDbCommand("AjoutDossier", Global_Data.CnPolitis)
CmdOleDb.CommandType = CommandType.StoredProcedure
CmdOleDb.Parameters.Clear()
Param = New OleDbParameter()
Param.ParameterName = "@TYPEDOSSIER"
Param.Direction = ParameterDirection.Input
Param.OleDbType = OleDbType.VarChar
Param.Value = ComboBoxTypeDossier.SelectedValue
CmdOleDb.Parameters.Add(Param)
------->>>>> CmdOleDb.ExecuteNonQuery() 'ERROR
End try
If I put OleDbTrans in comment It work fine but if one update fail, the other are in the DB (Order detail without Order header)
Thanks for your help![]()
![]()




Reply With Quote