다음을 통해 공유


ConnectionManager.AcquireConnection Method

Creates an instance of the connection type.

네임스페이스: Microsoft.SqlServer.Dts.Runtime
어셈블리: Microsoft.SqlServer.ManagedDTS (in microsoft.sqlserver.manageddts.dll)

구문

‘선언
Public Function AcquireConnection ( _
    txn As Object _
) As Object
public Object AcquireConnection (
    Object txn
)
public:
Object^ AcquireConnection (
    Object^ txn
)
public Object AcquireConnection (
    Object txn
)
public function AcquireConnection (
    txn : Object
) : Object

매개 변수

  • txn
    The handle to a transaction type.

반환 값

An object that contains the transaction connection.

주의

Pass null for the transaction parameter txn when the SupportsDTCTransactions property is false. If the SupportsDTCTransactions property is true, you can pass null in the transaction parameter to indicate that the container supports transactions, but is not going to participate.

The following code example shows how to add the OLE DB connection to the connection manager and acquire the connection.

// Create the package.
Package pkg = new Package();

// Add a ConnectionManager to the Connections collection.
ConnectionManager connMgr = pkg.Connections.Add("ADO.NET:OLEDB");
connMgr.Properties["RetainSameConnection"].SetValue(connMgr , true);
connMgr.ConnectionString = connStr;

// Aqcuire the connection.
object connection = connMgr.AcquireConnection(null);
' Create the package.
Dim pkg As Package =  New Package() 
 
' Add a ConnectionManager to the Connections collection.
Dim connMgr As ConnectionManager =  pkg.Connections.Add("ADO.NET:OLEDB") 
connMgr.Properties("RetainSameConnection").SetValue(connMgr , True)
connMgr.ConnectionString = connStr
 
' Aqcuire the connection.
Dim connection As Object =  connMgr.AcquireConnection(Nothing)

스레드 보안

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