Select from following answers:- Add a try-catch finally block after the TransactionScope declaration. Call the Complete method as the last statement of the try block.
- Enclose the TransactionScope declaration in a using block. Call the Complete method as the last statement of the block.

- Add a try-catch finally block after the TransactionScope declaration. Call the Complete method in the finally block.
- All Above
The correct pattern is to enclose the TransactionScope declaration in a using block and call the Complete method at the end of the block. This ensures that the transaction is committed immediately when the transactional code block is complete. If the code throws an exception, then the TransactionScope.Dispose method is called, aborting the transaction immediately.
If you enclose the TransactionScope declaration in a using block without adding a call to Complete, the transaction always aborts.
Show Correct Answer
Source: MeasureUp.Com | |
Alert Moderator