Ejemplo n.º 1
0
        private void Insert_TransactionRollbackButton_Click(object sender, EventArgs e)
        {
            // Transaction
            using (var transaction = new SqlTransactionScope())
            {
                try
                {
                    // Insert
                    this.InsertData();

                    // Throw
                    throw new Exception();

                    // Complete
                    transaction.Complete();
                }
                catch
                {
                    // ......
                }
            }

            // Refresh
            this.RefreshData();
        }
Ejemplo n.º 2
0
 // Methods
 public void Complete()
 {
     // Complete
     _transactionScope.Complete();
 }