Właściwość DataTypeInfo.TypeName
Zwraca nazwę typu danych.To pole jest tylko do odczytu.
Przestrzeń nazw: Microsoft.SqlServer.Dts.Runtime
Zestaw: Microsoft.SqlServer.ManagedDTS (w Microsoft.SqlServer.ManagedDTS.dll)
Składnia
'Deklaracja
Public ReadOnly Property TypeName As String
Get
'Użycie
Dim instance As DataTypeInfo
Dim value As String
value = instance.TypeName
public string TypeName { get; }
public:
property String^ TypeName {
String^ get ();
}
member TypeName : string
function get TypeName () : String
Wartość właściwości
Typ: System.String
Ciąg, który zawiera długi opis typu danych.
Uwagi
Zwraca dłuższa nazwa typu danych.Na przykład właściwość ta zwraca waluty dla typu DT_CY.
Przykłady
Poniższy przykład kodu iterację kolekcja i drukuje TypeEnumName i TypeName każdego typu danych w 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
Przykładowe dane wyjściowe:
TypeName: Pływak TypeEnumName: DT_R4
TypeName: zmiennoprzecinkowe podwójnej precyzji (TypeEnumName): DT_R8
TypeName: Waluta, TypeEnumName: DT_CY
TypeName: Data TypeEnumName: DT_DATE
TypeName: Wartość logiczna TypeEnumName: DT_BOOL
TypeName: Liczba dziesiętna, TypeEnumName: DT_DECIMAL
TypeName: jednobajtowe całkowita, TypeEnumName: DT_I1
TypeName: Liczba jednobajtowe całkowita bez znaku, TypeEnumName: DT_UI1
TypeName: dwubajtowy całkowita, TypeEnumName: DT_I2
TypeName: dwubajtowy niepodpisane integer, TypeEnumName: DT_UI2
TypeName: czterech bajtów całkowita, TypeEnumName: DT_I4
TypeName: Liczba czterech bajtów całkowita bez znaku, TypeEnumName: DT_UI4
TypeName: ośmiu bajtów całkowita, TypeEnumName: DT_I8
TypeName: Liczba ośmiu bajtów całkowita bez znaku, TypeEnumName: DT_UI8
TypeName: Sygnatura czasowa pliku, TypeEnumName: DT_FILETIME
TypeName: identyfikator unikatowy TypeEnumName: DT_GUID
TypeName: strumienia bajtów (TypeEnumName): DT_BYTES
TypeName: ciąg TypeEnumName: DT_STR
TypeName: Ciąg Unicode (TypeEnumName): DT_WSTR
TypeName: liczbowe TypeEnumName: DT_NUMERIC
TypeName: Data bazy danych (TypeEnumName): DT_DBDATE
TypeName: czas bazy danych (TypeEnumName): DT_DBTIME
TypeName: timestamp bazy danych TypeEnumName: DT_DBTIMESTAMP
TypeName: Obrázek TypeEnumName: DT_IMAGE
TypeName: Strumień tekstu (TypeEnumName): DT_TEXT
TypeName: Strumień tekstu Unicode, TypeEnumName: DT_NTEXT