EntityDataReader Classe

Definição

Lê um fluxo de linhas apenas de encaminhamento a partir de uma fonte de dados.Reads a forward-only stream of rows from a data source.

public ref class EntityDataReader : System::Data::Common::DbDataReader, System::Data::IExtendedDataRecord
public class EntityDataReader : System.Data.Common.DbDataReader, System.Data.IExtendedDataRecord
type EntityDataReader = class
    inherit DbDataReader
    interface IExtendedDataRecord
    interface IDataRecord
Public Class EntityDataReader
Inherits DbDataReader
Implements IExtendedDataRecord
Herança
Implementações

Comentários

Combina a funcionalidade da DbDataReader classe e da IExtendedDataRecord interface.Combines the functionality of the DbDataReader class and the IExtendedDataRecord interface.

Um EntityDataReader não tem um construtor público.An EntityDataReader has no public constructor. Ele só pode ser obtido por meio de uma das EntityCommand.ExecuteReader sobrecargas de método.It can only be obtained through one of the EntityCommand.ExecuteReader method overloads.

SQL Server coloca os parâmetros de saída dos procedimentos armazenados no final do fluxo de resultados, após todos os conjuntos de resultados.SQL Server puts output parameters from stored procedures at the end of the result stream, after all the result sets. Portanto, para obter valores de parâmetro de saída, um aplicativo deve consumir todos os registros em todos os conjuntos de resultados.Therefore, to get output parameter values, an application must consume all the records in all the result sets. Se o aplicativo fechar o EntityDataReader (que também fecharia DbDataReader ), os parâmetros de saída não poderão ser preenchidos.If the application closes the EntityDataReader (which would also close the DbDataReader), output parameters might not be populated.

EntityDataReader não consome implicitamente conjuntos de resultados para tornar os parâmetros de saída disponíveis.EntityDataReader does not implicitly consume result sets to make output parameters available. Portanto, observe o seguinte:Therefore, note the following:

Para obter exemplos de código, consulte trabalhando com EntityClient.For code examples, see Working with EntityClient.

Propriedades

DataRecordInfo

Obtém DataRecordInfo para este IExtendedDataRecord.Gets DataRecordInfo for this IExtendedDataRecord.

Depth

Obtém um valor que indica a profundidade de aninhamento da linha atual.Gets a value indicating the depth of nesting for the current row.

FieldCount

Obtém o número de colunas na linha atual.Gets the number of columns in the current row.

HasRows

Obtém um valor que indica se este EntityDataReader contém uma ou mais linhas.Gets a value that indicates whether this EntityDataReader contains one or more rows.

IsClosed

Obtém um valor que indica se o EntityDataReader está fechado.Gets a value indicating whether the EntityDataReader is closed.

Item[Int32]

Obtém o valor da coluna especificada como uma instância de Object.Gets the value of the specified column as an instance of Object.

Item[String]

Obtém o valor da coluna especificada como uma instância de Object.Gets the value of the specified column as an instance of Object.

RecordsAffected

Obtém o número de linhas alteradas, inseridas ou excluídas pela execução da instrução SQL.Gets the number of rows changed, inserted, or deleted by execution of the SQL statement.

VisibleFieldCount

Obtém o número de campos em EntityDataReader que não estão ocultos.Gets the number of fields in the EntityDataReader that are not hidden.

Métodos

Close()

Fecha o objeto EntityDataReader.Closes the EntityDataReader object.

CloseAsync()

Fecha de maneira assíncrona o objeto DbDataReader.Asynchronously closes the DbDataReader object.

(Herdado de DbDataReader)
CreateObjRef(Type)

Cria um objeto que contém todas as informações relevantes necessárias para gerar um proxy usado para se comunicar com um objeto remoto.Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.

(Herdado de MarshalByRefObject)
Dispose()

Libera todos os recursos usados pela instância atual da classe DbDataReader.Releases all resources used by the current instance of the DbDataReader class.

(Herdado de DbDataReader)
Dispose(Boolean)

Libera os recursos consumidos por este EntityDataReader e chama Close().Releases the resources consumed by this EntityDataReader and calls Close().

DisposeAsync()

Libera de forma assíncrona todos os recursos usados pela instância atual da classe DbDataReader.Asynchronously releases all resources used by the current instance of the DbDataReader class.

(Herdado de DbDataReader)
Equals(Object)

Determina se o objeto especificado é igual ao objeto atual.Determines whether the specified object is equal to the current object.

(Herdado de Object)
GetBoolean(Int32)

Obtém o valor da coluna especificada como um booliano.Gets the value of the specified column as a Boolean.

GetByte(Int32)

Obtém o valor da coluna especificada como um byte.Gets the value of the specified column as a byte.

GetBytes(Int32, Int64, Byte[], Int32, Int32)

Lê um fluxo de bytes na coluna especificada, iniciando no local indicado por dataIndex, no buffer, iniciando na posição indicada por bufferIndex.Reads a stream of bytes from the specified column, starting at location indicated by dataIndex, into the buffer, starting at the location indicated by bufferIndex.

GetChar(Int32)

Obtém o valor da coluna especificada como um único caractere.Gets the value of the specified column as a single character.

GetChars(Int32, Int64, Char[], Int32, Int32)

Lê um fluxo de caracteres na coluna especificada, iniciando no local indicado por dataIndex, no buffer, iniciando na posição indicada por bufferIndex.Reads a stream of characters from the specified column, starting at location indicated by dataIndex, into the buffer, starting at the location indicated by bufferIndex.

GetColumnSchemaAsync(CancellationToken)

Essa é a versão assíncrona de GetColumnSchema(DbDataReader).This is the asynchronous version of GetColumnSchema(DbDataReader). Provedores devem substituir com uma implementação apropriada.Providers should override with an appropriate implementation. Opcionalmente, o cancellationToken pode ser respeitado.The cancellationToken can optionally be honored. A implementação padrão invoca a chamada GetColumnSchema(DbDataReader) síncrona e retorna uma tarefa concluída.The default implementation invokes the synchronous GetColumnSchema(DbDataReader) call and returns a completed task. A implementação padrão retornará uma tarefa cancelada se já tiver passado um cancellationToken cancelado.The default implementation will return a cancelled task if passed an already cancelled cancellationToken. Exceções geradas por GetColumnSchema(DbDataReader) serão comunicadas por meio da propriedade Exceção de Tarefa retornada.Exceptions thrown by GetColumnSchema(DbDataReader) will be communicated via the returned Task Exception property.

(Herdado de DbDataReader)
GetData(Int32)

Retorna um leitor de dados aninhado para a coluna solicitada.Returns a nested data reader for the requested column.

(Herdado de DbDataReader)
GetDataReader(Int32)

Retorna os leitores aninhados como objetos DbDataReader.Returns nested readers as DbDataReader objects.

GetDataRecord(Int32)

Retorna um DbDataRecord aninhado.Returns a nested DbDataRecord.

GetDataTypeName(Int32)

Obtém o nome do tipo de dados da coluna especificada.Gets the name of the data type of the specified column.

GetDateTime(Int32)

Obtém o valor da coluna especificada como um objeto DateTime.Gets the value of the specified column as a DateTime object.

GetDbDataReader(Int32)

Retorna um objeto DbDataReader para o ordinal da coluna solicitado que pode ser substituído por uma implementação específica do provedor.Returns a DbDataReader object for the requested column ordinal that can be overridden with a provider-specific implementation.

GetDecimal(Int32)

Obtém o valor da coluna especificada como um objeto Decimal.Gets the value of the specified column as a Decimal object.

GetDouble(Int32)

Obtém o valor da coluna especificada como um número de ponto flutuante de precisão dupla.Gets the value of the specified column as a double-precision floating point number.

GetEnumerator()

Retorna um IEnumerator que pode ser usado para iterar pelas linhas do leitor de dados.Returns an IEnumerator that can be used to iterate through the rows in the data reader.

GetFieldType(Int32)

Obtém o tipo de dados da coluna especificada.Gets the data type of the specified column.

GetFieldValue<T>(Int32)

Obtém o valor da coluna especificada como um tipo solicitado.Gets the value of the specified column as the requested type.

(Herdado de DbDataReader)
GetFieldValueAsync<T>(Int32)

Obtém de forma assíncrona o valor da coluna especificada como um tipo solicitado.Asynchronously gets the value of the specified column as the requested type.

(Herdado de DbDataReader)
GetFieldValueAsync<T>(Int32, CancellationToken)

Obtém de forma assíncrona o valor da coluna especificada como um tipo solicitado.Asynchronously gets the value of the specified column as the requested type.

(Herdado de DbDataReader)
GetFloat(Int32)

Obtém o valor da coluna especificada como um número de ponto flutuante de precisão simples.Gets the value of the specified column as a single-precision floating point number.

GetGuid(Int32)

Obtém o valor da coluna especificada como um GUID (identificador global exclusivo).Gets the value of the specified column as a globally-unique identifier (GUID).

GetHashCode()

Serve como a função de hash padrão.Serves as the default hash function.

(Herdado de Object)
GetInt16(Int32)

Obtém o valor da coluna especificada como um inteiro com sinal de 16 bits.Gets the value of the specified column as a 16-bit signed integer.

GetInt32(Int32)

Obtém o valor da coluna especificada como um inteiro com sinal de 32 bits.Gets the value of the specified column as a 32-bit signed integer.

GetInt64(Int32)

Obtém o valor da coluna especificada como um inteiro com sinal de 64 bits.Gets the value of the specified column as a 64-bit signed integer.

GetLifetimeService()
Obsoleto.

Recupera o objeto de serviço de tempo de vida atual que controla a política de ciclo de vida para esta instância.Retrieves the current lifetime service object that controls the lifetime policy for this instance.

(Herdado de MarshalByRefObject)
GetName(Int32)

Obtém o nome da coluna, dado o ordinal da coluna com base em zero.Gets the name of the column, given the zero-based column ordinal.

GetOrdinal(String)

Obtém o ordinal da coluna, de acordo com o nome da coluna.Gets the column ordinal given the name of the column.

GetProviderSpecificFieldType(Int32)

Retorna o tipo de campo específico do provedor da coluna especificada.Returns the provider-specific field type of the specified column.

GetProviderSpecificValue(Int32)

Obtém o valor da coluna especificada como uma instância de Object.Gets the value of the specified column as an instance of Object.

GetProviderSpecificValues(Object[])

Obtém todas as colunas de atributo específicas do provedor na coleção para a linha atual.Gets all provider-specific attribute columns in the collection for the current row.

GetSchemaTable()

Retorna um DataTable que descreve os metadados da coluna do DbDataReader.Returns a DataTable that describes the column metadata of the DbDataReader.

GetSchemaTableAsync(CancellationToken)

Essa é a versão assíncrona de GetSchemaTable().This is the asynchronous version of GetSchemaTable(). Provedores devem substituir com uma implementação apropriada.Providers should override with an appropriate implementation. Opcionalmente, o cancellationToken pode ser respeitado.The cancellationToken can optionally be honored. A implementação padrão invoca a chamada GetSchemaTable() síncrona e retorna uma tarefa concluída.The default implementation invokes the synchronous GetSchemaTable() call and returns a completed task. A implementação padrão retornará uma tarefa cancelada se já tiver passado um cancellationToken cancelado.The default implementation will return a cancelled task if passed an already cancelled cancellationToken. Exceções geradas por GetSchemaTable() serão comunicadas por meio da propriedade Exceção de Tarefa retornada.Exceptions thrown by GetSchemaTable() will be communicated via the returned Task Exception property.

(Herdado de DbDataReader)
GetStream(Int32)

Obtém um fluxo para recuperar dados da coluna especificada.Gets a stream to retrieve data from the specified column.

(Herdado de DbDataReader)
GetString(Int32)

Obtém o valor da coluna especificada como uma instância de String.Gets the value of the specified column as an instance of String.

GetTextReader(Int32)

Obtém um leitor de texto para recuperar dados da coluna.Gets a text reader to retrieve data from the column.

(Herdado de DbDataReader)
GetType()

Obtém o Type da instância atual.Gets the Type of the current instance.

(Herdado de Object)
GetValue(Int32)

Obtém o valor da coluna especificada como uma instância de Object.Gets the value of the specified column as an instance of Object.

GetValues(Object[])

Popula uma matriz de objetos com os valores da coluna da linha atual.Populates an array of objects with the column values of the current row.

InitializeLifetimeService()
Obsoleto.

Obtém um objeto de serviço de tempo de vida para controlar a política de tempo de vida para essa instância.Obtains a lifetime service object to control the lifetime policy for this instance.

(Herdado de MarshalByRefObject)
IsDBNull(Int32)

Obtém um valor que indica se a coluna contém valores ausentes ou inexistentes.Gets a value that indicates whether the column contains nonexistent or missing values.

IsDBNullAsync(Int32)

Obtém, de maneira assíncrona, um valor que indica se a coluna contém valores ausentes ou inexistente.Asynchronously gets a value that indicates whether the column contains non-existent or missing values.

(Herdado de DbDataReader)
IsDBNullAsync(Int32, CancellationToken)

Obtém, de maneira assíncrona, um valor que indica se a coluna contém valores ausentes ou inexistente.Asynchronously gets a value that indicates whether the column contains non-existent or missing values.

(Herdado de DbDataReader)
MemberwiseClone()

Cria uma cópia superficial do Object atual.Creates a shallow copy of the current Object.

(Herdado de Object)
MemberwiseClone(Boolean)

Cria uma cópia superficial do objeto MarshalByRefObject atual.Creates a shallow copy of the current MarshalByRefObject object.

(Herdado de MarshalByRefObject)
NextResult()

Avança o leitor para o resultado seguinte ao ler os resultados de um lote de instruções.Advances the reader to the next result when reading the results of a batch of statements.

NextResultAsync()

Avança de maneira assíncrona o leitor para o resultado seguinte ao ler os resultados de um lote de instruções.Asynchronously advances the reader to the next result when reading the results of a batch of statements.

(Herdado de DbDataReader)
NextResultAsync(CancellationToken)

Avança de maneira assíncrona o leitor para o resultado seguinte ao ler os resultados de um lote de instruções.Asynchronously advances the reader to the next result when reading the results of a batch of statements.

(Herdado de DbDataReader)
Read()

Avança o leitor para o próximo registro em um conjunto de resultados.Advances the reader to the next record in a result set.

ReadAsync()

Avança de maneira assíncrona o leitor para o próximo registro em um conjunto de resultados.Asynchronously advances the reader to the next record in a result set.

(Herdado de DbDataReader)
ReadAsync(CancellationToken)

Avança de maneira assíncrona o leitor para o próximo registro em um conjunto de resultados.Asynchronously advances the reader to the next record in a result set.

(Herdado de DbDataReader)
ToString()

Retorna uma cadeia de caracteres que representa o objeto atual.Returns a string that represents the current object.

(Herdado de Object)

Implantações explícitas de interface

IDataReader.Close()

Para obter uma descrição desse membro, confira Close().For a description of this member, see Close().

(Herdado de DbDataReader)
IDataReader.GetSchemaTable()

Para obter uma descrição desse membro, confira GetSchemaTable().For a description of this member, see GetSchemaTable().

(Herdado de DbDataReader)
IDataRecord.GetData(Int32)

Para obter uma descrição desse membro, confira GetData(Int32).For a description of this member, see GetData(Int32).

(Herdado de DbDataReader)

Métodos de Extensão

CanGetColumnSchema(DbDataReader)

Obtém um valor que indica se um DbDataReader pode obter um esquema de coluna.Gets a value that indicates whether a DbDataReader can get a column schema.

GetColumnSchema(DbDataReader)

Obtém o esquema da coluna (coleção DbColumn) para um DbDataReader.Gets the column schema (DbColumn collection) for a DbDataReader.

Cast<TResult>(IEnumerable)

Converte os elementos de um IEnumerable para o tipo especificado.Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable)

Filtra os elementos de um IEnumerable com base em um tipo especificado.Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable)

Habilita a paralelização de uma consulta.Enables parallelization of a query.

AsQueryable(IEnumerable)

Converte um IEnumerable em um IQueryable.Converts an IEnumerable to an IQueryable.

Aplica-se a