ConnectionInfos.GetEnumerator Method
Returns a ConnectionInfoEnumerator that can iterate through the ConnectionInfos collection.
네임스페이스: Microsoft.SqlServer.Dts.Runtime
어셈블리: Microsoft.SqlServer.ManagedDTS (in microsoft.sqlserver.manageddts.dll)
구문
‘선언
Public Function GetEnumerator As ConnectionInfoEnumerator
public ConnectionInfoEnumerator GetEnumerator ()
public:
ConnectionInfoEnumerator^ GetEnumerator ()
public ConnectionInfoEnumerator GetEnumerator ()
public function GetEnumerator () : ConnectionInfoEnumerator
반환 값
A ConnectionInfoEnumerator for the ConnectionInfos collection.
예
The following code sample creates a ConnectionInfoEnumerator using the GetEnumerator method, and then iterates over the collection.
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SqlServer.Dts.Runtime;
namespace ConnInfos_Current
{
class Program
{
static void Main(string[] args)
{
Application dtsApplication = new Application();
ConnectionInfos connectionInfos = dtsApplication.ConnectionInfos;
//Create the enumerator.
ConnectionInfoEnumerator ConnInfoEnum = connectionInfos.GetEnumerator();
Console.WriteLine("The collection contains the following values:");
int i = 0;
while ((ConnInfoEnum.MoveNext()) && (ConnInfoEnum.Current != null))
Console.WriteLine("[{0}] {1}", i++, ConnInfoEnum.Current.Name);
}
}
}
Imports System
Imports System.Collections.Generic
Imports System.Text
Imports Microsoft.SqlServer.Dts.Runtime
Namespace ConnInfos_Current
Class Program
Shared Sub Main(ByVal args() As String)
Dim dtsApplication As Application = New Application()
Dim connectionInfos As ConnectionInfos = dtsApplication.ConnectionInfos
'Create the enumerator.
Dim ConnInfoEnum As ConnectionInfoEnumerator = connectionInfos.GetEnumerator()
Console.WriteLine("The collection contains the following values:")
Dim i As Integer = 0
While (ConnInfoEnum.MoveNext()) &&(ConnInfoEnum.Current <> Nothing)
Console.WriteLine("[{0}] {1}",i = Console.WriteLine("[{0}] {1}",i + 1
End While
End Sub
End Class
End Namespace
Sample Output:
The collection contains the following values:
[0] Connection Manager for Files
[1] Connection Manager for SQL Server 2005 Compact Edition
[2] Connection Manager for Multiple Flat Files
[3] Connection Manager for ADO
[4] Connection Manager for ODBC
[5] Connection Manager for ADO.NET
[6] Connection Manager for OLE DB
[7] Connection Manager for Multiple Files
[8] Connection Manager for Flat Files
[9] Connection Manager for Analysis Services
[10] Connection Manager for FTP
[11] Connection Manager for HTTP
[12] Message Queue Connection Manager
[13] SMTP Connection Manager
[14] WMI Connection Manager
스레드 보안
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 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.
참고 항목
참조
ConnectionInfos Class
ConnectionInfos Members
Microsoft.SqlServer.Dts.Runtime Namespace