Hi
I want to update two datasets with in the same transaction.
But, unfortunately i get the following error
Error: "Execute requires the command to have a tranasaction object when the connection assigned to the command is in a pending local transaction. The transaction property of the command has not been initialized"
Please help me, give me any suggestions
I want to update two datasets with in the same transaction.
VB.NET:
conn.Open()
Dim cbcomando As New SqlCommandBuilder(adDoc)
Dim cbLinhas As New SqlCommandBuilder(adLinhasDoc2)
myTrans = conn.BeginTransaction()
adDoc.SelectCommand.Transaction = myTrans
adLinhasDoc2.SelectCommand.Transaction = myTrans
Try
adDoc.Update(dsDoc, "Documentos")
adLinhasDoc2.Update(dsLinhasDoc2, "LDocumentos")
myTrans.Commit()
Catch ex As Exception
MsgBox(ex.Message)
myTrans.Rollback()
End Try
But, unfortunately i get the following error
Error: "Execute requires the command to have a tranasaction object when the connection assigned to the command is in a pending local transaction. The transaction property of the command has not been initialized"
Please help me, give me any suggestions