Share via


ContextUtil.TransactionId プロパティ

定義

現在の COM+ DTC トランザクションの GUID を取得します。

public:
 static property Guid TransactionId { Guid get(); };
public static Guid TransactionId { get; }
static member TransactionId : Guid
Public Shared ReadOnly Property TransactionId As Guid

プロパティ値

現在の COM+ DTC トランザクションが存在する場合は、そのトランザクションを表す GUID。

例外

使用できる COM+ コンテキストはありません。

次のコード例では、 プロパティの値を TransactionId 取得します。

[Transaction(TransactionOption::Required)]
public ref class ContextUtil_TransactionId: public ServicedComponent
{
public:
   void Example()
   {
      // Display the ID of the transaction in which the current COM+ context
      // is enlisted.
      Console::WriteLine( "Transaction ID: {0}", ContextUtil::TransactionId );
   }
};
[Transaction(TransactionOption.Required)]
public class ContextUtil_TransactionId : ServicedComponent
{
    public void Example()
    {
        // Display the ID of the transaction in which the current COM+ context
        // is enlisted.
        Console.WriteLine("Transaction ID: {0}", ContextUtil.TransactionId);
    }
}
<Transaction(TransactionOption.Required)>  _
Public Class ContextUtil_TransactionId
    Inherits ServicedComponent
    
    Public Sub Example() 
        ' Display the ID of the transaction in which the current COM+ context
        ' is enlisted.
        MsgBox("Transaction ID: " & ContextUtil.TransactionId.ToString())

    End Sub
End Class

適用対象