Share via


LogEntryInfos.Item[Object] 속성

정의

컬렉션에서 LogEntryInfo 개체를 가져옵니다. 이 Item[Object] 속성은 클래스의 기본 인덱서 LogEntryInfos 이며 LogEntryInfos[...]를 사용하여 값을 조회할 수 있습니다. 구문을 사용하여 문을 다시 작성해야 합니다.

public:
 property Microsoft::SqlServer::Dts::Runtime::LogEntryInfo ^ default[System::Object ^] { Microsoft::SqlServer::Dts::Runtime::LogEntryInfo ^ get(System::Object ^ index); };
public Microsoft.SqlServer.Dts.Runtime.LogEntryInfo this[object index] { get; }
member this.Item(obj) : Microsoft.SqlServer.Dts.Runtime.LogEntryInfo
Default Public ReadOnly Property Item(index As Object) As LogEntryInfo

매개 변수

index
Object

컬렉션에서 찾을 LogEntryInfo 개체의 이름, 설명, ID 또는 인덱스입니다.

속성 값

컬렉션의 LogEntryInfo 개체입니다.

예제

다음 코드 예제에서는 두 가지 메서드를 사용하여 컬렉션에서 항목을 검색합니다. 첫 번째 메서드는 구문을 사용하여 logInfos[0] 컬렉션의 첫 번째 위치에 있는 전체 개체를 검색하고 개체에 logInfos 배치합니다. 이제 개체에서 평소와 같이 모든 속성을 검색할 logInfo 수 있습니다. 두 번째 메서드는 컬렉션의 첫 번째 개체에서 특정 속성을 검색하는 방법을 보여 줍니다.

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

namespace LogEntryInfosTest  
{  
    class Program  
    {  
        static void Main(string[] args)  
        {  
            // The package is one of the SSIS Samples.  
            string mySample = @"C:\Program Files\Microsoft SQL Server\100\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 LogEntryInfos from the package.  
            LogEntryInfos logInfos = pkg.LogEntryInfos;  

            //Using the Item method syntax of [x], obtain the   
            //first entry. Also, using the [x] syntax, retrieve a  
            // specific property, the Name.   
            LogEntryInfo logInfo = logInfos[0];  
            String nameOfFirstItem = logInfos[0].Name;  

            //Print the name of the logEntryInfo oabject located  
            //at position [0].  
            Console.WriteLine("The ID of the first log entry is: {0}", logInfo.ID);  
            Console.WriteLine("The Name of the first log entry is: {0}", nameOfFirstItem);  
        }  
    }  
}  
Imports System  
Imports System.Collections.Generic  
Imports System.Text  
Imports Microsoft.SqlServer.Dts.Runtime  

Namespace LogEnTryInfosTest  
    Class Program  
        Shared  Sub Main(ByVal args() As String)  
            ' The package is one of the SSIS Samples.  
            Dim mySample As String =  "C:\Program Files\Microsoft SQL Server\100\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 LogEntryInfos from the package.  
            Dim logInfos As LogEnTryInfos =  pkg.LogEnTryInfos   

            'Using the Item method syntax of [x], obtain the   
            'first entry. Also, using the [x] syntax, retrieve a  
            ' specific property, the Name.   
            Dim logInfo As LogEnTryInfo =  logInfos(0)   
            Dim nameOfFirstItem As String =  logInfos(0).Name   

            'Print the name of the logEntryInfo oabject located  
            'at position [0].  
            Console.WriteLine("The ID of the first log entry is: {0}", logInfo.ID)  
            Console.WriteLine("The Name of the first log entry is: {0}", nameOfFirstItem)  
        End Sub  
    End Class  
End Namespace  

샘플 출력:

첫 번째 로그 항목의 ID는 {D5BD104A-9504-4087-A742-44B2BD90A09D}입니다.

첫 번째 로그 항목의 이름은 진단입니다.

설명

메서드 호출 Contains 이 반환 true되는 경우 구문을 LogEntryInfo[index]사용하여 컬렉션에서 지정된 요소에 액세스할 수 있습니다. 반환false되는 Contains 경우 이 속성은 예외를 throw합니다.

C#에서 이 속성은 LogEntryInfos 클래스의 인덱서입니다.

적용 대상