Compartir a través de


Clase DataColEnumerator

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

Jerarquía de herencia

System.Object
  Microsoft.SqlServer.Dts.Runtime.Enumerators.ADO.DataColEnumerator

Espacio de nombres:  Microsoft.SqlServer.Dts.Runtime.Enumerators.ADO
Ensamblado:  Microsoft.SqlServer.ForEachADOEnumerator (en Microsoft.SqlServer.ForEachADOEnumerator.dll)

Sintaxis

'Declaración
Public NotInheritable Class DataColEnumerator _
    Implements IEnumerator
'Uso
Dim instance As DataColEnumerator
public sealed class DataColEnumerator : IEnumerator
public ref class DataColEnumerator sealed : IEnumerator
[<SealedAttribute>]
type DataColEnumerator =  
    class 
        interface IEnumerator 
    end
public final class DataColEnumerator implements IEnumerator

El tipo DataColEnumerator expone los siguientes miembros.

Propiedades

  Nombre Descripción
Propiedad pública Current Infraestructura. Gets the current object in the collection.

Arriba

Métodos

  Nombre Descripción
Método público Equals (Se hereda de Object.)
Método público GetHashCode (Se hereda de Object.)
Método público GetType (Se hereda de Object.)
Método público MoveNext Infraestructura. Indicates whether the enumerator moves to the next element.
Método público Reset Infraestructura. Resets the DataColEnumerator to its default configuration.
Método público ToString (Se hereda de Object.)

Arriba

Comentarios

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 data column into the enumerator and iterate over it.

Vardisp.LockOneForWrite("VariableThatHadIndexSetToMinus1", vars)

DataColEnumerator dcEnum = (DataColEnumerator)vars[0]
foreach (object o in dcEnum)
{
    // 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.

Seguridad para subprocesos

Cualquier miembro público static (Shared en Visual Basic) de este tipo es seguro para subprocesos. No se garantiza que los miembros de instancia sean seguros para subprocesos.

Vea también

Referencia

Espacio de nombres Microsoft.SqlServer.Dts.Runtime.Enumerators.ADO