Can you guys tell me the difference between the开发者_如何学Gose two objects? Thanks!
A MySqlTransaction is a MySQL specific implementation of System.Data.IDbTransaction, that is it represents a transaction in a MySQL database.
TransactionScope is used to make blocks of code, not just database calls, transactional.
The TransactionScope will enlist the MySqlTransaction as part of a larger transactional code block so you can perform some database writes and other things as part of the transactionscope and either they will all be committed or they will all be rolled back.
精彩评论