共用方式為


FieldColEnumerator 類別

This class is used when the ADO enumerator returns a Dataset or Recordset. This enumerator allows you to enumerate over the fields. This class cannot be inherited.

繼承階層

System. . :: . .Object
  Microsoft.SqlServer.Dts.Runtime.Enumerators.ADO..::..FieldColEnumerator

命名空間:  Microsoft.SqlServer.Dts.Runtime.Enumerators.ADO
組件:  Microsoft.SqlServer.ForEachADOEnumerator (在 Microsoft.SqlServer.ForEachADOEnumerator.dll 中)

語法

'宣告
Public NotInheritable Class FieldColEnumerator _
    Implements IEnumerator
'用途
Dim instance As FieldColEnumerator
public sealed class FieldColEnumerator : IEnumerator
public ref class FieldColEnumerator sealed : IEnumerator
[<SealedAttribute>]
type FieldColEnumerator =  
    class
        interface IEnumerator
    end
public final class FieldColEnumerator implements IEnumerator

FieldColEnumerator 型別公開下列成員。

屬性

  名稱 說明
公用屬性 Current 基礎結構。

上層

方法

  名稱 說明
公用方法 Equals (繼承自 Object。)
受保護的方法 Finalize (繼承自 Object。)
公用方法 GetHashCode (繼承自 Object。)
公用方法 GetType (繼承自 Object。)
受保護的方法 MemberwiseClone (繼承自 Object。)
公用方法 MoveNext 基礎結構。
公用方法 Reset 基礎結構。
公用方法 ToString (繼承自 Object。)

上層

備註

The members of this class cannot be used directly. This class is used by the foreach keyword (For Each in Visual Basic). The following code example is a piece of a foreach loop showing simply how to use indexing to place a field into the enumerator and iterate over it.

Vardisp.LockOneForWrite("VariableThatHadIndexSetToMinus1", vars)

FieldColEnumerator fEnum = (FieldColEnumerator)vars[0]
foreach (object o in fEnum)
{
    // Do something with o, 
    // where o is the value of the column, just as you would get
    // if you had a variable for a specific index.
}

You must set the index for the variable mapping to -1 to retrieve the entire collection into the variable, instead of retrieving just a column which is based on an index, so then you can access it directly.

執行緒安全性

這個型別的任何公用 static (在 Visual Basic 中為 Shared) 成員都是執行緒安全的。並不是所有的執行個體成員都保證可以用於所有的執行緒。