Application.DataTypeInfoFromDataType(DataType) 메서드

정의

중요

이 API는 CLS 규격이 아닙니다.

지정한 데이터 형식에 대한 DataTypeInfo 개체를 반환합니다.

public:
 Microsoft::SqlServer::Dts::Runtime::DataTypeInfo ^ DataTypeInfoFromDataType(Microsoft::SqlServer::Dts::Runtime::Wrapper::DataType dt);
[System.CLSCompliant(false)]
public Microsoft.SqlServer.Dts.Runtime.DataTypeInfo DataTypeInfoFromDataType (Microsoft.SqlServer.Dts.Runtime.Wrapper.DataType dt);
[<System.CLSCompliant(false)>]
member this.DataTypeInfoFromDataType : Microsoft.SqlServer.Dts.Runtime.Wrapper.DataType -> Microsoft.SqlServer.Dts.Runtime.DataTypeInfo
Public Function DataTypeInfoFromDataType (dt As DataType) As DataTypeInfo

매개 변수

dt
DataType

데이터 형식입니다.

반환

DataTypeInfo 개체입니다.

특성

예제

다음 코드 예제에서는 DT_I4 형식의 이름을 검색합니다.

#region Using directives  
using System;  
using System.Collections.Generic;  
using System.Text;  
using Microsoft.SqlServer.Dts.Runtime;  
using Wrapper = Microsoft.SqlServer.Dts.Runtime.Wrapper;  
#endregion  

namespace Application_and_Package  
{  
    class PackageTest  
    {  
        static void Main(string[] args)  
        {  
            Application app = new Application();  
            DataTypeInfo dti = app.DataTypeInfoFromDataType(Wrapper.DataType.DT_I4);  
           Console.WriteLine("DataType = " + dti.TypeName);  
        }  
    }  
}  
#Region "Using directives  
Imports System  
Imports System".Collections.Generic  
Imports System.Text  
Imports Microsoft.SqlServer.Dts.Runtime  
Imports Wrapper = Microsoft.SqlServer.Dts.Runtime.Wrapper  
#End Region  

Namespace Application_and_Package  
    Class PackageTest  
        Sub Main(ByVal args() As String)  
            Dim app As Application =  New Application()   
            Dim dti As DataTypeInfo =  app.DataTypeInfoFromDataType(Wrapper.DataType.DT_I4)   
           Console.WriteLine("DataType = " + dti.TypeName)  
        End Sub  
    End Class  
End Namespace  

샘플 출력:

DataType = four-byte signed integer

설명

이 메서드를 사용하면 특정 데이터 형식에 대한 데이터 형식 정보를 가져올 수 있습니다. 예를 들어 매개 변수에 dt "DT_I4"을 전달하는 경우 반환 값은 "DT_I4"의 열거형 이름과 "4바이트 부호 있는 정수"의 형식 이름을 포함하는 개체입니다 DataTypeInfo . 이 정보는 사용자 인터페이스 또는 오류 메시지에 형식 정보를 표시하는 데 유용합니다. 데이터 형식에 대한 자세한 내용은 Integration Services Data Types을 참조하세요.

호출자 참고

이 메서드를 사용하려면 프로젝트에 Microsoft.SqlServer.Dts.Runtime.Wrapper를 추가해야 합니다. C# 코드 예제 using 에서 지시문은 이 네임스페이스의 별칭을 변수 Wrapper로 지정했습니다.

적용 대상