DtsContainer.TransactionOption Propriété

Définition

Obtient ou définit une valeur d'énumération DTSTransactionOption qui indique si le conteneur participe aux transactions.

public:
 property Microsoft::SqlServer::Dts::Runtime::DTSTransactionOption TransactionOption { Microsoft::SqlServer::Dts::Runtime::DTSTransactionOption get(); void set(Microsoft::SqlServer::Dts::Runtime::DTSTransactionOption value); };
[Microsoft.SqlServer.Dts.Runtime.Localization.LocalizablePropertyCategory(typeof(Microsoft.SqlServer.Dts.Runtime.Localized), "PropertyCategoryTransactions")]
[Microsoft.SqlServer.Dts.Runtime.Localization.LocalizablePropertyDescription(typeof(Microsoft.SqlServer.Dts.Runtime.Localized), "TransactionOptionDesc")]
public Microsoft.SqlServer.Dts.Runtime.DTSTransactionOption TransactionOption { get; set; }
[<Microsoft.SqlServer.Dts.Runtime.Localization.LocalizablePropertyCategory(typeof(Microsoft.SqlServer.Dts.Runtime.Localized), "PropertyCategoryTransactions")>]
[<Microsoft.SqlServer.Dts.Runtime.Localization.LocalizablePropertyDescription(typeof(Microsoft.SqlServer.Dts.Runtime.Localized), "TransactionOptionDesc")>]
member this.TransactionOption : Microsoft.SqlServer.Dts.Runtime.DTSTransactionOption with get, set
Public Property TransactionOption As DTSTransactionOption

Valeur de propriété

Énumération DTSTransactionOption qui indique si ce conteneur peut participer à des transactions.

Attributs

Exemples

L’exemple de code suivant crée un Package, qui est une classe qui hérite de DtsContainer. Montre Package l’utilisation de plusieurs propriétés héritées.

using System;  
using System.Collections.Generic;  
using System.Text;  
using Microsoft.SqlServer.Dts.Runtime;  

namespace Microsoft.SqlServer.SSIS.Samples  
{  
    class Program  
    {  
        static void Main(string[] args)  
        {  
            Application app = new Application();  
            Package pkg = new Package();  

            // Package name must be assigned.  
            pkg.Name = "My DtsContainer inheritance test package";  

            // Display the values that manually assigned.  
            Console.WriteLine("Package Name: {0}", pkg.Name);  

            // Packages are assigned the following default values when created.  
            Console.WriteLine("Package ID:           {0}", pkg.ID);  
            Console.WriteLine("FailPackageOnFailure: {0}", pkg.FailPackageOnFailure);  
            Console.WriteLine("FailParentOnFailure:  {0}", pkg.FailParentOnFailure);  
            Console.WriteLine("Locale ID:            {0}", pkg.LocaleID);  
            Console.WriteLine("Is DefaultLocaleID?   {0}", pkg.IsDefaultLocaleID);  
            Console.WriteLine("Isolation Level:      {0}", pkg.IsolationLevel);  
            Console.WriteLine("LoggingMode:          {0}", pkg.LoggingMode);  
            Console.WriteLine("MaximumErrorCount:    {0}", pkg.MaximumErrorCount);  
            Console.WriteLine("TransactionOption:    {0}", pkg.TransactionOption);  
        }  
    }  
}  
Imports System  
Imports System.Collections.Generic  
Imports System.Text  
Imports Microsoft.SqlServer.Dts.Runtime  

Namespace Microsoft.SqlServer.SSIS.Samples  
    Class Program  
        Shared  Sub Main(ByVal args() As String)  
            Dim app As Application =  New Application()   
            Dim pkg As Package =  New Package()   

            ' Package name must be assigned.  
            pkg.Name = "My DtsContainer inheritance test package"  

            ' Display the values that manually assigned.  
            Console.WriteLine("Package Name: {0}", pkg.Name)  

            ' Packages are assigned the following default values when created.  
            Console.WriteLine("Package ID:           {0}", pkg.ID)  
            Console.WriteLine("FailPackageOnFailure: {0}", pkg.FailPackageOnFailure)  
            Console.WriteLine("FailParentOnFailure:  {0}", pkg.FailParentOnFailure)  
            Console.WriteLine("Locale ID:            {0}", pkg.LocaleID)  
            Console.WriteLine("Is DefaultLocaleID?   {0}", pkg.IsDefaultLocaleID)  
            Console.WriteLine("Isolation Level:      {0}", pkg.IsolationLevel)  
            Console.WriteLine("LoggingMode:          {0}", pkg.LoggingMode)  
            Console.WriteLine("MaximumErrorCount:    {0}", pkg.MaximumErrorCount)  
            Console.WriteLine("TransactionOption:    {0}", pkg.TransactionOption)  
        End Sub  
    End Class  
End Namespace  

Exemple de sortie :

Nom du package : Package de test d’héritage My DtsContainer

ID du package : {2C2FAA96-35BA-4C5E-A39A-C5D7D30A0D79}

FailPackageOnFailure : False

FailParentOnFailure : False

ID des paramètres régionaux : 1033

DefaultLocaleID ? False

Niveau d’isolation : sérialisable

LoggingMode : UseParentSetting

MaximumErrorCount : 1

TransactionOption : prise en charge

S’applique à