Share via


ConnectionContext.Transaction Property

Gets or sets the transactions to use when executing the Transact SQL (T-SQL) statements.

Namespace:  Microsoft.VisualStudio.TeamSystem.Data.UnitTesting
Assembly:  Microsoft.VisualStudio.TeamSystem.Data.UnitTesting (in Microsoft.VisualStudio.TeamSystem.Data.UnitTesting.dll)

Syntax

'Declaration
Public Property Transaction As DbTransaction
'Usage
Dim instance As ConnectionContext
Dim value As DbTransaction

value = instance.Transaction

instance.Transaction = value
public DbTransaction Transaction { get; set; }
public:
property DbTransaction^ Transaction {
    DbTransaction^ get ();
    void set (DbTransaction^ value);
}
public function get Transaction () : DbTransaction
public function set Transaction (value : DbTransaction)

Property Value

Type: System.Data.Common.DbTransaction

Remarks

You can use this property to modify the generated test code to run within the scope of a single transaction. For example, create, update, and delete application tests change the database state. However, you can prevent one test's operations from affecting the execution of another test by executing your test within the scope of a single transaction. After the test is complete and verified, you can roll back the transaction.

Permissions

See Also

Reference

ConnectionContext Class

ConnectionContext Members

Microsoft.VisualStudio.TeamSystem.Data.UnitTesting Namespace