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
精彩评论