Partager via


ConnectionManager.SupportsDTCTransactions Propriété

Définition

Retourne une valeur Boolean qui indique si la connexion prend en charge des transactions MS DTC (Microsoft Distributed Transaction Coordinator).

public:
 property bool SupportsDTCTransactions { bool get(); };
[Microsoft.SqlServer.Dts.Runtime.Localization.LocalizablePropertyDescription(typeof(Microsoft.SqlServer.Dts.Runtime.Localized), "SupportsDTCTransactionsDesc")]
public bool SupportsDTCTransactions { get; }
[<Microsoft.SqlServer.Dts.Runtime.Localization.LocalizablePropertyDescription(typeof(Microsoft.SqlServer.Dts.Runtime.Localized), "SupportsDTCTransactionsDesc")>]
member this.SupportsDTCTransactions : bool
Public ReadOnly Property SupportsDTCTransactions As Boolean

Valeur de propriété

true si la connexion prend en charge les transactions MS DTC ; sinon, false.

Attributs

Exemples

L’exemple de code suivant charge un package existant qui a deux connexions. Il itère par le biais des gestionnaires de connexions dans le package et imprime les valeurs des différentes propriétés, y compris le Boolean. SupportsDTCTransactions

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

namespace Connections_Collection  
{  
    class Program  
    {  
        static void Main(string[] args)  
        {  
           // The package is one of the SSIS Samples.  
            string mySample = @"C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\Package Samples\CalculatedColumns Sample\CalculatedColumns\CalculatedColumns.dtsx";  

            // Create an application and load the sample.  
            Application app = new Application();  
            Package pkg = app.LoadPackage(mySample, null);  
            Connections myConns = pkg.Connections;  
            int connCount = myConns.Count;  
            Console.WriteLine("The number of connections in the package is: {0}", connCount);  

            // Enumerate over the collection, printing out  
            // the values for various properties.  
            foreach (ConnectionManager connMgr in myConns)  
            {  
                Console.WriteLine("ConnectionString:        {0}", connMgr.ConnectionString);  
                Console.WriteLine("CreationName:            {0}", connMgr.CreationName);  
                Console.WriteLine("DelayValidation:         {0}", connMgr.DelayValidation);  
                Console.WriteLine("Description:             {0}", connMgr.Description);  
                Console.WriteLine("HostType:                {0}", connMgr.HostType);  
                Console.WriteLine("ID:                      {0}", connMgr.ID);  
                Console.WriteLine("InnerObject:             {0}", connMgr.InnerObject);  
                Console.WriteLine("Name:                    {0}", connMgr.Name);  
                Console.WriteLine("ProtectionLevel:         {0}", connMgr.ProtectionLevel);  
                Console.WriteLine("SupportsDTCTransactions: {0}", connMgr.SupportsDTCTransactions);  
            }  
            Console.WriteLine("");  
        }  
    }  
}  
Imports System  
Imports System.Collections.Generic  
Imports System.Text  
Imports Microsoft.SqlServer.Dts.Runtime  

Namespace Connections_Collection  
    Class Program  
        Shared  Sub Main(ByVal args() As String)  
           ' The package is one of the SSIS Samples.  
            Dim mySample As String =  "C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\Package Samples\CalculatedColumns Sample\CalculatedColumns\CalculatedColumns.dtsx"   

            ' Create an application and load the sample.  
            Dim app As Application =  New Application()   
            Dim pkg As Package =  app.LoadPackage(mySample,Nothing)   
            Dim myConns As Connections =  pkg.Connections   
            Dim connCount As Integer =  myConns.Count   
            Console.WriteLine("The number of connections in the package is: {0}", connCount)  

            ' Enumerate over the collection, printing out  
            ' the values for various properties.  
            Dim connMgr As ConnectionManager  
            For Each connMgr In myConns  
                Console.WriteLine("ConnectionString:        {0}", connMgr.ConnectionString)  
                Console.WriteLine("CreationName:            {0}", connMgr.CreationName)  
                Console.WriteLine("DelayValidation:         {0}", connMgr.DelayValidation)  
                Console.WriteLine("Description:             {0}", connMgr.Description)  
                Console.WriteLine("HostType:                {0}", connMgr.HostType)  
                Console.WriteLine("ID:                      {0}", connMgr.ID)  
                Console.WriteLine("InnerObject:             {0}", connMgr.InnerObject)  
                Console.WriteLine("Name:                    {0}", connMgr.Name)  
                Console.WriteLine("ProtectionLevel:         {0}", connMgr.ProtectionLevel)  
                Console.WriteLine("SupportsDTCTransactions: {0}", connMgr.SupportsDTCTransactions)  
            Next  
            Console.WriteLine("")  
        End Sub  
    End Class  
End Namespace  

Exemple de sortie :

Le nombre de connexions dans le package est : 2

ConnectionString : Source de données=localhost;Initial Catalog=AdventureWorks; Provider=SQLOLEDB.1;Integrated Security=SSPI; Conserver les informations de sécurité=False; Traduction automatique=false;

CreationName : OLEDB

DelayValidation : False

Description :

HostType : ConnectionManager

ID : {3427BFE1-F10C-4B7E-8E70-E8D9DC7DBA3}

InnerObject : System.__ComObject

Nom : localhost. Adventureworks

ProtectionLevel : EncryptSensitiveWithUserKey

SupportsDTCTransactions : True

ConnectionString : C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\Package Samples\CalculatedColumns Sample\CalculatedColumns\results.txt

CreationName : FLATFILE

DelayValidation : False

Description :

HostType : ConnectionManager

ID : {48B66F8D-7DFE-4D85-91C7-099655484B2}

InnerObject : System.__ComObject

Nom : Résumé des transactions par Product1

ProtectionLevel : EncryptSensitiveWithUserKey

SupportsDTCTransactions : False

S’applique à