LogProviderInfos.GetEnumerator メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
LogProviderInfosコレクションの反復に使うために、列挙器を返します。
public:
Microsoft::SqlServer::Dts::Runtime::LogProviderInfoEnumerator ^ GetEnumerator();
public Microsoft.SqlServer.Dts.Runtime.LogProviderInfoEnumerator GetEnumerator();
override this.GetEnumerator : unit -> Microsoft.SqlServer.Dts.Runtime.LogProviderInfoEnumerator
Public Function GetEnumerator () As LogProviderInfoEnumerator
返品
コレクションの反復に使うための LogProviderInfoEnumerator 列挙子。
例
以下のコードサンプルは、LogProviderInfoEnumeratorメソッドを使ってGetEnumeratorを作成し、その後コレクションを反復します。
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SqlServer.Dts.Runtime;
namespace LogProvInfoProperties
{
class Program
{
static void Main(string[] args)
{
Application app = new Application();
LogProviderInfos infos = app.LogProviderInfos;
//Create the Enumerator.
LogProviderInfoEnumerator myEnumerator = infos.GetEnumerator();
Console.WriteLine("The collection contains the following values:");
//Iterate over the collection using the indexer instead of foreach.
int i = 0;
while ((myEnumerator.MoveNext()) && (myEnumerator.Current != null))
Console.WriteLine("[{0}] {1}", i++, myEnumerator.Current.Name);
}
}
}
Imports System
Imports System.Collections.Generic
Imports System.Text
Imports Microsoft.SqlServer.Dts.Runtime
Namespace LogProvInfoProperties
Class Program
Shared Sub Main(ByVal args() As String)
Dim app As Application = New Application()
Dim infos As LogProviderInfos = app.LogProviderInfos
'Create the Enumerator.
Dim myEnumerator As LogProviderInfoEnumerator = infos.GetEnumerator()
Console.WriteLine("The collection contains the following values:")
'Iterate over the collection using the indexer instead of foreach.
Dim i As Integer = 0
While (myEnumerator.MoveNext()) &&(myEnumerator.Current <> Nothing)
Console.WriteLine("[{0}] {1}",i = Console.WriteLine("[{0}] {1}",i + 1
End While
End Sub
End Class
End Namespace
出力例:
コレクションには以下の値が含まれています:
[0] テキストファイルのSSISログ提供者
[1] SQL Server Profiler用のSSISログ提供者
[2] SQL Server用のSSISログプロバイダー
[3] Windowsイベントログ用のSSISログプロバイダー
[4] XMLファイル用のSSISログプロバイダー