LoggingOptions.GetColumnFilter(String, DTSEventColumnFilter) 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
지정된 이벤트에 대한 열 필터를 반환합니다.
public:
void GetColumnFilter(System::String ^ eventName, Microsoft::SqlServer::Dts::Runtime::DTSEventColumnFilter % columnFilter);
public void GetColumnFilter(string eventName, ref Microsoft.SqlServer.Dts.Runtime.DTSEventColumnFilter columnFilter);
member this.GetColumnFilter : string * DTSEventColumnFilter -> unit
Public Sub GetColumnFilter (eventName As String, ByRef columnFilter As DTSEventColumnFilter)
매개 변수
- eventName
- String
통제하고 싶은 열의 이벤트 이름입니다.
- columnFilter
- DTSEventColumnFilter
열이 포함되었는지(참)인지, 제외되었는지(거짓)인지에 따라 값이 참 또는 거짓으로 설정된 A DTSEventColumnFilter .
예제
다음 코드 예시는 를 Package 생성하고 로그 제공자를 선택합니다. 코드 예제는 to DTSEventColumnFilter 필드 true 를 로그에 포함시키거나 false 로그에서 제외하도록 설정합니다.
SetColumnFilter 그 다음, 값이 인 true 필드는 패키지가 이벤트가 발생 OnError 할 때 로그된다고 정의합니다. 새 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
샘플 출력:
컴퓨터: 맞아요
연산자: 참
출처이름: True
출처 ID: 거짓
ExecutionID: 거짓
메시지 텍스트: 거짓
DataBytes: False