DataTypeInfos.GetEnumerator Yöntemi
Döndürür bir DataTypeInfoEnumerator boyunca yinelemek DataTypeInfo koleksiyon.
Ad Alanı: Microsoft.SqlServer.Dts.Runtime
Derleme: Microsoft.SqlServer.ManagedDTS (Microsoft.SqlServer.ManagedDTS içinde.dll)
Sözdizimi
'Bildirim
Public Function GetEnumerator As DataTypeInfoEnumerator
'Kullanım
Dim instance As DataTypeInfos
Dim returnValue As DataTypeInfoEnumerator
returnValue = instance.GetEnumerator()
public DataTypeInfoEnumerator GetEnumerator()
public:
DataTypeInfoEnumerator^ GetEnumerator()
member GetEnumerator : unit -> DataTypeInfoEnumerator
public function GetEnumerator() : DataTypeInfoEnumerator
Dönüş Değeri
Tür: Microsoft.SqlServer.Dts.Runtime.DataTypeInfoEnumerator
A DataTypeInfoEnumerator for the DataTypeInfo koleksiyon.
Örnekler
Aşağıdaki kod örneği oluşturur bir DataTypeInfoEnumerator kullanarak GetEnumerator yöntem ve ardından koleksiyon. yineleme
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SqlServer.Dts.Runtime;
namespace DataTypeInfos_GetEnum_Current
{
class Program
{
static void Main(string[] args)
{
//Create the DataTypeInfos collection.
DataTypeInfos dataInfos = new Application().DataTypeInfos;
//Create the enumerator.
DataTypeInfoEnumerator myEnumerator = dataInfos.GetEnumerator();
Console.WriteLine("The collection contains the following values:");
int i = 0;
DataTypeInfo dtiObject;
while ((myEnumerator.MoveNext()) && (myEnumerator.Current != null))
{
dtiObject = (DataTypeInfo)myEnumerator.Current;
Console.WriteLine("[{0}] {1} {2}", i++, dtiObject.TypeName, dtiObject.TypeEnumName);
}
// Reset puts the index pointer before the beginning.
// Do not retrieve from the collection until MoveNext is called.
myEnumerator.Reset();
myEnumerator.MoveNext();
// Now that the enumerator has been reset, and moved to the
// first item in the collection, show the first item.
dtiObject = (DataTypeInfo)myEnumerator.Current;
Console.WriteLine("The first item in the enumerator after Reset:");
Console.WriteLine("{0}, {1}", dtiObject.TypeName, dtiObject.TypeEnumName);
}
}
}
Imports System
Imports System.Collections.Generic
Imports System.Text
Imports Microsoft.SqlServer.Dts.Runtime
Namespace DataTypeInfos_GetEnum_Current
Class Program
Shared Sub Main(ByVal args() As String)
'Create the DataTypeInfos collection.
Dim dataInfos As DataTypeInfos = New Application().DataTypeInfos
'Create the Enumerator.
Dim myEnumerator As DataTypeInfoEnumerator = dataInfos.GetEnumerator()
Console.WriteLine("The collection contains the following values:")
Dim i As Integer = 0
Dim dtiObject As DataTypeInfo
While (myEnumerator.MoveNext()) &&(myEnumerator.Current <> Nothing)
dtiObject = CType(myEnumerator.Current, DataTypeInfo)
Console.WriteLine("[{0}] {1} {2}",i = Console.WriteLine("[{0}] {1} {2}",i + 1
End While
' Reset puts the index pointer before the beginning.
' Do not retrieve from the collection until MoveNext is called.
myEnumerator.Reset()
myEnumerator.MoveNext()
' Now that the enumerator has been reset, and moved to the
' first item in the collection, show the first item.
dtiObject = CType(myEnumerator.Current, DataTypeInfo)
Console.WriteLine("The first item in the enumerator after Reset:")
Console.WriteLine("{0}, {1}", dtiObject.TypeName, dtiObject.TypeEnumName)
End Sub
End Class
End Namespace
Örnek Çıktı:
Koleksiyon aşağıdaki değerleri içerir:
[0] kayan nokta DT_R4
[1] çift duyarlıklı kayan nokta DT_R8
[2] para birimi dt_cy
[3] tarih dt_date
[4] Boole dt_bool
[5] ondalık DT_DECIMAL
[6] tek bayt işaretli tamsayı DT_I1
[7] tek bayt işaretsiz tamsayı DT_UI1
[8] iki bayt işaretli tamsayı DT_I2
[9] iki baytlık imzalanmamış tamsayı DT_UI2
[10] dört bayt işaretli tamsayı DT_I4
[11] dört baytlık imzalanmamış tamsayı DT_UI4
[12] sekiz bayt işaretli tamsayı DT_I8
[13] sekiz bayt işaretsiz tamsayı DT_UI8
[14] dosya zaman damgası DT_FILETIME
[15] DT_GUID benzersiz tanımlayıcısı
[16] bayt akışı dt_bytes
[17] dize dt_str
[18] Unicode dize dt_wstr
[19] sayısal DT_NUMERIC
[20] veritabanı tarih dt_dbdate
[21] veritabanı saat DT_DBTIME
[22] veritabanı zaman damgası DT_DBTIMESTAMP
[23] resim DT_IMAGE
[24] metin akışı dt_text
[25] Unicode metin akışı dt_ntext
Sayacı Sıfırla sonra ilk öğe:
Float, DT_R4