Partilhar via


SqlCeCommand.Transaction Property

Note: This namespace, class, or member is supported only in version 1.1 of the .NET Framework.

Gets or sets the transaction in which the SqlCeCommand executes.

  [Visual Basic]
  Public Property Transaction As SqlCeTransaction
[C#]
public SqlCeTransaction Transaction {get; set;}
[C++]
public: __property SqlCeTransaction* get_Transaction();
public: __property void set_Transaction(SqlCeTransaction*);
[JScript]
public function get Transaction() : SqlCeTransaction;
public function set Transaction(SqlCeTransaction);

Property Value

The SqlCeTransaction. The default value is a null reference (Nothing in Visual Basic).

Remarks

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 of a SqlCeTransaction object that is not connected to the same SqlCeConnection as the SqlCeCommand object, an exception will be thrown the next time you execute a statement.

If SqlCeCommand runs with SqlCeTransaction set to null, the command runs in autocommit mode; therefore, each statement runs in its own transaction.

Requirements

Platforms: .NET Compact Framework

.NET Framework Security:

See Also

SqlCeCommand Class | SqlCeCommand Members | System.Data.SqlServerCe Namespace

Syntax based on .NET Framework version 1.1.
Documentation version 1.1.1.

Send comments on this topic.

© Microsoft Corporation. All rights reserved.