DataTypeInfo.TypeEnumName 属性

定义

返回数据类型的符号名称。 此字段为只读。

public:
 property System::String ^ TypeEnumName { System::String ^ get(); };
public string TypeEnumName { get; }
member this.TypeEnumName : string
Public ReadOnly Property TypeEnumName As String

属性值

一个包含数据类型的符号名称的字符串。

示例

下面的代码示例循环访问集合,并打印 TypeEnumNameTypeName SQL Server Integration Services (SSIS) 中的每个数据类型。

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

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

            //Iterate over the collection, printing the values  
            //of the properties.  
            foreach (DataTypeInfo dInfo in dataInfos)  
            {  
                Console.WriteLine("TypeName: {0}, TypeEnumName: {1}", dInfo.TypeName, dInfo.TypeEnumName);  
                //Console.WriteLine("TypeEnumName   {0}", dInfo.TypeEnumName);  
            }  
        }  
    }  
}  
Imports System  
Imports System.Collections.Generic  
Imports System.Text  
Imports Microsoft.SqlServer.Dts.Runtime  

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

            'Iterate over the collection, printing the values  
            'of the properties.  
            Dim dInfo As DataTypeInfo  
            For Each dInfo In dataInfos  
                Console.WriteLine("TypeName: {0}, TypeEnumName: {1}", dInfo.TypeName, dInfo.TypeEnumName)  
                'Console.WriteLine("TypeEnumName   {0}", dInfo.TypeEnumName);  
            Next  
        End Sub  
    End Class  
End Namespace  

示例输出:

TypeName:float、TypeEnumName:DT_R4

TypeName:双精度浮点数,TypeEnumName:DT_R8

TypeName:currency、TypeEnumName:DT_CY

TypeName: date, TypeEnumName: DT_DATE

TypeName:Boolean、TypeEnumName:DT_BOOL

TypeName:decimal、TypeEnumName:DT_DECIMAL

TypeName:单字节有符号整数,TypeEnumName: DT_I1

TypeName:单字节无符号整数,TypeEnumName:DT_UI1

TypeName:双字节有符号整数,TypeEnumName: DT_I2

TypeName:双字节无符号整数,TypeEnumName: DT_UI2

TypeName:四字节有符号整数,TypeEnumName: DT_I4

TypeName:四字节无符号整数,TypeEnumName: DT_UI4

TypeName:八字节有符号整数,TypeEnumName: DT_I8

TypeName:8 字节无符号整数,TypeEnumName: DT_UI8

TypeName:文件时间戳,TypeEnumName:DT_FILETIME

TypeName:唯一标识符,TypeEnumName:DT_GUID

TypeName:字节流,TypeEnumName:DT_BYTES

TypeName: string, TypeEnumName: DT_STR

TypeName: Unicode 字符串, TypeEnumName: DT_WSTR

TypeName:numeric、TypeEnumName:DT_NUMERIC

TypeName:数据库日期、TypeEnumName:DT_DBDATE

TypeName:数据库时间、TypeEnumName:DT_DBTIME

TypeName:数据库时间戳,TypeEnumName:DT_DBTIMESTAMP

TypeName: image, TypeEnumName: DT_IMAGE

TypeName:文本流、TypeEnumName:DT_TEXT

TypeName:Unicode 文本流,TypeEnumName:DT_NTEXT

注解

这会返回数据类型的短名称。 例如,此属性返回浮点数的DT_R4。

适用于