다음을 통해 공유


LogProvider.ID Property

Gets the ID of the LogProvider. This property is read-only.

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

구문

‘선언
Public ReadOnly Property ID As String
public string ID { get; }
public:
virtual property String^ ID {
    String^ get () sealed;
}
/** @property */
public final String get_ID ()
public final function get ID () : String

속성 값

Returns the integer ID of the LogProvider.

주의

This property is read-only and is assigned by the runtime when the LogProvider is added to the package. This ID property is one of the strings that is used to add the LogProvider to the LogProviders collection when using the Add method. The ID is also referred to as the ClassID. You can also use the CreationName, also referred to as the ProgID, to add a log provider to the collection. For a list of the ProgIDs and ClassIDs assigned to the log providers, see Add.

The following code example loads a package for which logging has been enabled. After loading the package, the LogProviders collection is created, and each log provider in the collection is enumerated over, printing the values for each property, including the GUID or ClassID, ID.

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

namespace LogProvider_Properties_Test
{
    class Program
    {
        static void Main(string[] args)
        {
            // The package is one of the SSIS samples,
            // modified to log information to the "SSIS
            // log provider for Text files".
            string mySample = @"C:\Program Files\Microsoft SQL Server\90\Samples\Integration Services\Package Samples\CalculatedColumns Sample\CalculatedColumns\CalculatedColumns.dtsx";
            // Create the Application, and load the sample.
            Application app = new Application();
            Package pkg = app.LoadPackage(mySample, null);

            // Get the LogProviders collection from the package.
            LogProviders logProvs = pkg.LogProviders;
            foreach (LogProvider logProv in logProvs)
            {
                Console.WriteLine("ConfigString:   {0}", logProv.ConfigString);
                Console.WriteLine("CreationName    {0}", logProv.CreationName);
                Console.WriteLine("DelayValidation {0}", logProv.DelayValidation);
                Console.WriteLine("Description     {0}", logProv.Description);
                Console.WriteLine("HostType        {0}", logProv.HostType);
                Console.WriteLine("ID              {0}", logProv.ID);
                Console.WriteLine("InnerObject     {0}", logProv.InnerObject);
                Console.WriteLine("Name            {0}", logProv.Name);
             }
        }
    }
}
Imports System
Imports System.Collections.Generic
Imports System.Text
Imports Microsoft.SqlServer.Dts.Runtime
Imports Microsoft.SqlServer.Dts.Tasks.DMQueryTask
 
Namespace LogProvider_Properties_Test
    Class Program
        Shared  Sub Main(ByVal args() As String)
            ' The package is one of the SSIS samples,
            ' modified to log information to the "SSIS
            ' log provider for Text files".
            Dim mySample As String =  "C:\Program Files\Microsoft SQL Server\90\Samples\Integration Services\Package Samples\CalculatedColumns Sample\CalculatedColumns\CalculatedColumns.dtsx" 
            ' Create the Application, and load the sample.
            Dim app As Application =  New Application() 
            Dim pkg As Package =  app.LoadPackage(mySample,Nothing) 
 
            ' Get the LogProviders collection from the package.
            Dim logProvs As LogProviders =  pkg.LogProviders 
            Dim logProv As LogProvider
            For Each logProv In logProvs
                Console.WriteLine("ConfigString:   {0}", logProv.ConfigString)
                Console.WriteLine("CreationName    {0}", logProv.CreationName)
                Console.WriteLine("DelayValidation {0}", logProv.DelayValidation)
                Console.WriteLine("Description     {0}", logProv.Description)
                Console.WriteLine("HostType        {0}", logProv.HostType)
                Console.WriteLine("ID              {0}", logProv.ID)
                Console.WriteLine("InnerObject     {0}", logProv.InnerObject)
                Console.WriteLine("Name            {0}", logProv.Name)
            Next
        End Sub
    End Class
End Namespace

Sample Output:

ConfigString:

CreationName DTS.LogProviderTextFile.1

DelayValidation False

Description Writes log entries for events to a CSV file

HostType LogProvider

ID {1E107E39-DB79-4F02-B8A7-61D88F2DEF63}

InnerObject System.__ComObject

Name SSIS log provider for Text files

스레드 보안

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 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.

참고 항목

참조

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