Notifies that a transaction has begun and that all modifications to the database are only committed after a call to Commit. Alternatively, if Rollback is called then all changes are aborted. To execute other statements for the transaction call the Execute and ExecuteNonQuery functions. Because all changes to the database must be executed on the same connection DatabaseObjects maintains an open connection until the Commit or Rollback functions are called. When transactions are not being used connections are opened and closed for each SQL statement executed i.e. (INSERT/UPDATE/SELECT...).

Namespace: DatabaseObjects
Assembly: DatabaseObjects (in DatabaseObjects.dll) Version: 3.8.1.0

Syntax

C#
public void Begin()
Visual Basic
Public Sub Begin
Visual C++
public:
void Begin()

Examples

CopyC#
Public Sub Shadows Save()

    Mybase.ParentDatabase.Transactions.Begin()

    MyBase.Save
    Me.Details.Save

    'Execute any other statements here via
    'MyBase.ParentDatabase.Transactions.Execute()...

    Mybase.ParentDatabase.Transactions.Commit()

End sub

See Also