|
|
There are three Transaction classes: SqlTransaction, OleDbTransaction, and OdbcTransaction. You use a Transaction object to represent a database transaction, and an object of the SqlTransaction class to represent a database transaction in a SQL Server database. Table 14.1 shows some of the SqlTransaction properties, and Table 14.2 shows some of the SqlTransaction methods. You'll see the use of some of these properties and methods in this chapter.
PROPERTY | TYPE | DESCRIPTION |
---|---|---|
Connection | SqlConnection | Gets the connection for the transaction. |
IsolationLevel | IsolationLevel | Gets the isolation level for the transaction (see "Setting the Transaction Isolation Level"). |
METHOD | RETURN TYPE | DESCRIPTION |
---|---|---|
Commit() | void | Performs a commit to permanently record the SQL statements in the transaction. |
Rollback() | void | Overloaded. Performs a rollback to undo the SQL statements in the transaction. |
Save() | void | Creates a savepoint in the transaction that can be used to undo a portion of that transaction. The string passed to this method specifies the savepoint name. You can then roll back the transaction to that savepoint (see "Setting a Savepoint"). |
|
|