
| Desenvolvimento | | :: :: :: :: :: ::
|
| CERTIFICAÇÃO | |
|
|
| LINKS |
 |
|
| |  | | Home |  |
 | | Usando transação em C# |  | Exemplo de como usar transação usando Enterprise Libraryusing (DbConnection connection = db.CreateConnection()) { connection.Open(); DbTransaction transaction = connection.BeginTransaction();
try { // Credit the first account. db.ExecuteNonQuery(creditCommand, transaction); // Debit the second account. db.ExecuteNonQuery(debitCommand, transaction);
// Commit the transaction. transaction.Commit(); result = true; } catch { // Roll back the transaction. transaction.Rollback(); } connection.Close(); return result; }
[03/05/2007 13:52 - Fabrizio Gianfratti]
| | 
| WebMail | |
| |
| TRADUTOR ONLINE |
 | |
| Top Páginas | | :: :: :: :: ::
|
|