DataTypeInfos.Item[Object] 속성

정의

컬렉션에서 DataTypeInfo 개체를 반환합니다.

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

매개 변수

index
Object

컬렉션에서 검색할 DataTypeInfo 개체의 인덱스입니다.

속성 값

DataTypeInfo 개체입니다.

예제

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

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

namespace DataTypeInfos_GetEnum_Current  
{  
    class Program  
    {  
        static void Main(string[] args)  
        {  
            //Create the DataTypeInfos collection.  
            DataTypeInfos dataInfos = new Application().DataTypeInfos;  

            //Using the Item method syntax of [x], obtain the first entry.  
            DataTypeInfo dtInfo = dataInfos[0];  
            String nameOfFirstItem = dataInfos[0].TypeName;  

            //Print the name of the task object located at position [0].  
            Console.WriteLine("The TypeEnumName of the first item is: {0}", dtInfo.TypeEnumName);  
            Console.WriteLine("The TypeName of the first task is: {0}", nameOfFirstItem);  
        }  
    }  
}  
Imports System  
Imports System.Collections.Generic  
Imports System.Text  
Imports Microsoft.SqlServer.Dts.Runtime  

Namespace DataTypeInfos_GetEnum_Current  
    Class Program  
        Shared  Sub Main(ByVal args() As String)  
            'Create the DataTypeInfos collection.  
            Dim dataInfos As DataTypeInfos =  New Application().DataTypeInfos   

            'Using the Item method syntax of [x], obtain the first entry.  
            Dim dtInfo As DataTypeInfo =  dataInfos(0)   
            Dim nameOfFirstItem As String =  dataInfos(0).TypeName   

            'Print the name of the task object located at position [0].  
            Console.WriteLine("The TypeEnumName of the first item is: {0}", dtInfo.TypeEnumName)  
            Console.WriteLine("The TypeName of the first task is: {0}", nameOfFirstItem)  
        End Sub  
    End Class  
End Namespace  

샘플 출력:

첫 번째 항목의 TypeEnumName은 DT_R4

첫 번째 작업의 TypeName은 float입니다.

설명

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

적용 대상