Torna al Thread

bool result = true; try { TransactionOptions transactionOptions = new TransactionOptions(); transactionOptions.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted; transactionOptions.Timeout = new TimeSpan(0, 5, 0); using (TransactionScope scopeDelAmministratore = new TransactionScope(TransactionScopeOption.Required, transactionOptions)) { result = Delete("Amministratori", "fkAmministratore", userId); if (result) scopeDelAmministratore.Complete(); else scopeDelAmministratore.Dispose(); }//TransactionScope return true; }//Try catch (TransactionAbortedException ex) { return false; } catch (ApplicationException ex) { return false; }
Copyright © dotNetHell.it 2002-2025
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5