DataTypeInfo.TypeName Properti
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
Mengembalikan nama jenis data. Bidang ini hanya-baca.
public:
property System::String ^ TypeName { System::String ^ get(); };
public string TypeName { get; }
member this.TypeName : string
Public ReadOnly Property TypeName As String
Nilai Properti
String yang berisi deskripsi panjang jenis data.
Contoh
Contoh kode berikut melakukan iterasi melalui pengumpulan dan mencetak TypeEnumName dan TypeName dari setiap jenis data di 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
Contoh Output:
TypeName: float, TypeEnumName: DT_R4
TypeName: float presisi ganda, TypeEnumName: DT_R8
TypeName: mata uang, TypeEnumName: DT_CY
TypeName: date, TypeEnumName: DT_DATE
TypeName: Boolean, TypeEnumName: DT_BOOL
TypeName: desimal, TypeEnumName: DT_DECIMAL
TypeName: bilangan bulat bertanda tangan byte tunggal, TypeEnumName: DT_I1
TypeName: bilangan bulat tanpa tanda byte tunggal, TypeEnumName: DT_UI1
TypeName: bilangan bulat bertanda tangan dua byte, TypeEnumName: DT_I2
TypeName: bilangan bulat dua byte yang tidak ditandatangani, TypeEnumName: DT_UI2
TypeName: bilangan bulat bertanda empat byte, TypeEnumName: DT_I4
TypeName: bilangan bulat empat byte yang tidak ditandatangani, TypeEnumName: DT_UI4
TypeName: bilangan bulat bertanda tangan delapan byte, TypeEnumName: DT_I8
TypeName: bilangan bulat delapan byte yang tidak ditandatangani, TypeEnumName: DT_UI8
TypeName: tanda waktu file, TypeEnumName: DT_FILETIME
TypeName: pengidentifikasi unik, TypeEnumName: DT_GUID
TypeName: byte stream, TypeEnumName: DT_BYTES
TypeName: string, TypeEnumName: DT_STR
TypeName: Untai (karakter) Unicode, TypeEnumName: DT_WSTR
TypeName: numerik, TypeEnumName: DT_NUMERIC
TypeName: tanggal database, TypeEnumName: DT_DBDATE
TypeName: waktu database, TypeEnumName: DT_DBTIME
TypeName: tanda waktu database, TypeEnumName: DT_DBTIMESTAMP
TypeName: image, TypeEnumName: DT_IMAGE
TypeName: aliran teks, TypeEnumName: DT_TEXT
TypeName: Aliran teks Unicode, TypeEnumName: DT_NTEXT
Keterangan
Mengembalikan nama yang lebih panjang untuk jenis data. Misalnya, properti mengembalikan mata uang untuk jenis DT_CY.