Select from following answers:- Set the Transaction property of SqlCommand to the transaction returned by BeginTransaction.
- Set an isolation level of ReadCommitted or higher explicitly when beginning the transaction.
- Begin the transaction before creating the command.
- All Above
You assign the Transaction object to the Transaction property of the SqlCommand to be executed. If a command is executed on a connection with an active transaction and the Transaction object has not been assigned to the Transaction property of the Command object, an exception is thrown.
Calling Commit between command executions does not fix the problem.
Beginning the transaction before creating the command does not fix the problem.
Show Correct Answer
Source: MeasureUp.Com | |
Alert Moderator