ConnectionManager.SupportsDTCTransactions Property
Returns a Boolean that indicates if the connection supports Microsoft Distributed Transaction Coordinator (MS DTC) transactions.
네임스페이스: Microsoft.SqlServer.Dts.Runtime
어셈블리: Microsoft.SqlServer.ManagedDTS (in microsoft.sqlserver.manageddts.dll)
구문
‘선언
Public ReadOnly Property SupportsDTCTransactions As Boolean
public bool SupportsDTCTransactions { get; }
public:
property bool SupportsDTCTransactions {
bool get ();
}
/** @property */
public boolean get_SupportsDTCTransactions ()
public function get SupportsDTCTransactions () : boolean
속성 값
true if the connection supports MS DTC transactions; otherwise, false.
예
The following code example loads an existing package that has two connections. It iterates through the connection managers in the package and prints out the values for the various properties, including the 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\90\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\90\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
Sample Output:
The number of connections in the package is: 2
ConnectionString: Data Source=localhost;Initial Catalog=AdventureWorks;Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Auto Translate=False;
CreationName: OLEDB
DelayValidation: False
Description:
HostType: ConnectionManager
ID: {3427BFE1-F10C-4B7E-8E70-E8D9DC7DDBA3}
InnerObject: System.__ComObject
Name: localhost.AdventureWorks
ProtectionLevel: EncryptSensitiveWithUserKey
SupportsDTCTransactions: True
ConnectionString: C:\Program Files\Microsoft SQL Server\90\Samples\Integration Services\Package Samples\CalculatedColumns Sample\CalculatedColumns\results.txt
CreationName: FLATFILE
DelayValidation: False
Description:
HostType: ConnectionManager
ID: {48B66F8D-7DFE-4D85-91C7-0999655484B2}
InnerObject: System.__ComObject
Name: Transaction Summary by Product1
ProtectionLevel: EncryptSensitiveWithUserKey
SupportsDTCTransactions: False
스레드 보안
Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
플랫폼
개발 플랫폼
지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.
대상 플랫폼
지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.
참고 항목
참조
ConnectionManager Class
ConnectionManager Members
Microsoft.SqlServer.Dts.Runtime Namespace