다음을 통해 공유


Application.DataTypeInfoFromDataType Method

Returns the DataTypeInfo object for the specified data type. This method is not CLS-compliant.

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

구문

‘선언
<CLSCompliantAttribute(False)> _
Public Function DataTypeInfoFromDataType ( _
    dt As DataType _
) As DataTypeInfo
[CLSCompliantAttribute(false)] 
public DataTypeInfo DataTypeInfoFromDataType (
    DataType dt
)
[CLSCompliantAttribute(false)] 
public:
DataTypeInfo^ DataTypeInfoFromDataType (
    DataType dt
)
/** @attribute CLSCompliantAttribute(false) */ 
public DataTypeInfo DataTypeInfoFromDataType (
    DataType dt
)
CLSCompliantAttribute(false) 
public function DataTypeInfoFromDataType (
    dt : DataType
) : DataTypeInfo

매개 변수

  • dt
    The data type.

반환 값

A DataTypeInfo object.

주의

This method lets you get data type information for a specific data type. For example, if you pass "DT_I4" in the dt parameter, the return value is the DataTypeInfo object that contains the enumeration name of "DT_I4" and the type name of "four-byte signed integer". This information is useful for displaying the type information in a user interface or error message. For more information about data types, see Integration Services 데이터 형식.

호출자를 위한 정보: This method requires the addition of the Microsoft.SqlServer.Dts.Runtime.Wrapper to the project. In the C# code example, the using directive has aliased this namespace with the variable, Wrapper.

The following code example retrieves the name of the type, 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

Sample Output:

DataType = four-byte signed integer

스레드 보안

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

참고 항목

참조

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