Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Application.DataTypeInfoFromDataType Method (DataType)


Applies To: SQL Server 2016 Preview

Returns the DataTypeInfo object for the specified data type.

Namespace:   Microsoft.SqlServer.Dts.Runtime
Assembly:  Microsoft.SqlServer.ManagedDTS (in Microsoft.SqlServer.ManagedDTS.dll)

Public Function DataTypeInfoFromDataType (
	dt As DataType
) As DataTypeInfo


Type: Microsoft.SqlServer.Dts.Runtime.Wrapper.DataType

The data type.

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 Data Types.

Notes to Callers:

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.

Legacy Code Example

The following code example retrieves the name of the type, DT_I4.

#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

Return to top
© 2015 Microsoft