System.Data.SqlClient Namespace SqlCommand Class
Sets or retrieves the transaction in which the SqlCommand executes.
Script |
SqlCommand.Transaction [ = sqlTransaction ] |
The property is read/write with no default value.
You cannot set the Transaction property if it is already set to a specific value, and the command is in the process of executing. If you set the transaction property to an SqlTransaction object that is not connected to the same SqlConnection as the SqlCommand object, an exception will be thrown the next time you attempt to execute a statement.
SqlCommand Members