次の方法で共有


LoggingOptions.GetColumnFilter Method

指定したイベントの列フィルタを返します。

名前空間: Microsoft.SqlServer.Dts.Runtime
アセンブリ: Microsoft.SqlServer.ManagedDTS (microsoft.sqlserver.manageddts.dll 内)

構文

'宣言
Public Sub GetColumnFilter ( _
    eventName As String, _
    ByRef columnFilter As DTSEventColumnFilter _
)
public void GetColumnFilter (
    string eventName,
    ref DTSEventColumnFilter columnFilter
)
public:
void GetColumnFilter (
    String^ eventName, 
    DTSEventColumnFilter% columnFilter
)
public void GetColumnFilter (
    String eventName, 
    /** @ref */ DTSEventColumnFilter columnFilter
)
JScript は、値と型の引数の参照渡しをサポートしていません。

パラメータ

  • eventName
    制御する列のイベントの名前です。
  • columnFilter
    列を含める (true) か、除外する (false) かにより、true または false に設定された値を持つ DTSEventColumnFilter です。

使用例

次のコード例では、Package を作成し、ログ プロバイダを選択します。コード例では次に、DTSEventColumnFilter フィールドをログに含める場合はこのフィールドを true に設定し、ログから除外する場合は false に設定します。SetColumnFilter は、パッケージで OnError イベントが発生すると true の値のフィールドがログに記録されるように定義します。新しい DTSEventColumnFilter が作成され、GetColumnFilter を使用して、既存のフィルタからの値が入力されます。

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

namespace HttpClientConn
{
    class Program
    {
        static void Main(string[] args)
        {
            Package pkg = new Package();
            LogProvider log1 = pkg.LogProviders.Add("DTS.LogProviderTextFile.1");
            pkg.LoggingOptions.SelectedLogProviders.Add(log1);
            LoggingOptions lOpts = pkg.LoggingOptions;

            DTSEventColumnFilter ecf = new DTSEventColumnFilter();
            // Set the detailed information to log when the event occurs.
            // This specifies to log the Computer, Operator, and SourceName only.
            ecf.Computer = true;
            ecf.Operator = true;
            ecf.SourceName = true;
            ecf.SourceID = false;
            ecf.ExecutionID = false;
            ecf.MessageText = false;
            ecf.DataBytes = false;
            // The event is the first parameter, and the columns to log is the enumeration. 
            lOpts.SetColumnFilter("OnError", ecf);

            // Now that the column filters are set, retrieve them using 
            // GetColumnFilter.
            DTSEventColumnFilter newECF = new DTSEventColumnFilter();
            lOpts.GetColumnFilter("OnError", ref newECF);

            // Show that the new DTSEventColumnFilter has been set properly.
            Console.WriteLine("Computer: {0}", newECF.Computer);
            Console.WriteLine("Operator: {0}", newECF.Operator);
            Console.WriteLine("SourceName: {0}", newECF.SourceName);
            Console.WriteLine("SourceID: {0}", newECF.SourceID);
            Console.WriteLine("ExecutionID: {0}", newECF.ExecutionID);
            Console.WriteLine("MessageText: {0}", newECF.MessageText);
            Console.WriteLine("DataBytes: {0}", newECF.DataBytes);
        }
    }
}
Imports System
Imports System.Collections.Generic
Imports System.Text
Imports Microsoft.SqlServer.Dts.Runtime
 
Namespace HttpClientConn
    Class Program
        Shared  Sub Main(ByVal args() As String)
            Dim pkg As Package =  New Package() 
            Dim log1 As LogProvider =  pkg.LogProviders.Add("DTS.LogProviderTextFile.1") 
            pkg.LoggingOptions.SelectedLogProviders.Add(log1)
            Dim lOpts As LoggingOptions =  pkg.LoggingOptions 
 
            Dim ecf As DTSEventColumnFilter =  New DTSEventColumnFilter() 
            ' Set the detailed information to log when the event occurs.
            ' This specifies to log the Computer, Operator, and SourceName only.
            ecf.Computer = True
            ecf.Operator = True
            ecf.SourceName = True
            ecf.SourceID = False
            ecf.ExecutionID = False
            ecf.MessageText = False
            ecf.DataBytes = False
            ' The event is the first parameter, and the columns to log is the enumeration. 
            lOpts.SetColumnFilter("OnError", ecf)
 
            ' Now that the column filters are set, retrieve them using 
            ' GetColumnFilter.
            Dim NewECF As DTSEventColumnFilter =  New DTSEventColumnFilter() 
            lOpts.GetColumnFilter("OnError",ref NewECF)
 
            ' Show that the new DTSEventColumnFilter has been set properly.
            Console.WriteLine("Computer: {0}", NewECF.Computer)
            Console.WriteLine("Operator: {0}", NewECF.Operator)
            Console.WriteLine("SourceName: {0}", NewECF.SourceName)
            Console.WriteLine("SourceID: {0}", NewECF.SourceID)
            Console.WriteLine("ExecutionID: {0}", NewECF.ExecutionID)
            Console.WriteLine("MessageText: {0}", NewECF.MessageText)
            Console.WriteLine("DataBytes: {0}", NewECF.DataBytes)
        End Sub
    End Class
End Namespace

サンプルの出力 :

Computer: True

Operator: True

SourceName: True

SourceID: False

ExecutionID: False

MessageText: False

DataBytes: False

スレッド セーフ

この型の public static (Microsoft Visual Basic では共有 ) メンバは、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。

プラットフォーム

開発プラットフォーム

サポートされているプラットフォームの一覧については、「SQL Server 2005 のインストールに必要なハードウェアおよびソフトウェア」を参照してください。

対象プラットフォーム

サポートされているプラットフォームの一覧については、「SQL Server 2005 のインストールに必要なハードウェアおよびソフトウェア」を参照してください。

参照

関連項目

LoggingOptions Class
LoggingOptions Members
Microsoft.SqlServer.Dts.Runtime Namespace