开发者

Transactions and Rollback for Typed DataSets in VB.NET

How do I include the typed dataset in my transaction so that I can rollback when I catch an error? Is there a way where I can commit both the typed and untyped dataset?

          myTransaction = calConnect.Connection.BeginTransaction("myRollback")

         Try
            CommandInsertCE.Transaction = myTransaction

            CommandInsertCE.ExecuteNonQuery()
            myTransaction.Commit()

            dgvwCalibRes.DataSource = CalibrationDataSet.Tables("Calib开发者_如何学CrationTrials")
            taCalTrials.Update(Me.CalibrationDataSet.CalibrationTrials)

        Catch ex As Exception
            myTransaction.Rollback("myRollback")

        End Try
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜