Editare

Partajați prin


EntityDataReader Class

Definition

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
Inheritance
Implements

Remarks

Combines the functionality of the DbDataReader class and the IExtendedDataRecord interface.

An EntityDataReader has no public constructor. It can only be obtained through one of the EntityCommand.ExecuteReader method overloads.

SQL Server puts output parameters from stored procedures at the end of the result stream, after all the result sets. Therefore, to get output parameter values, an application must consume all the records in all the result sets. If the application closes the EntityDataReader (which would also close the DbDataReader), output parameters might not be populated.

EntityDataReader does not implicitly consume result sets to make output parameters available. Therefore, note the following:

For code examples, see Working with EntityClient.

Properties

DataRecordInfo

Gets DataRecordInfo for this IExtendedDataRecord.

Depth

Gets a value indicating the depth of nesting for the current row.

FieldCount

Gets the number of columns in the current row.

HasRows

Gets a value that indicates whether this EntityDataReader contains one or more rows.

IsClosed

Gets a value indicating whether the EntityDataReader is closed.

Item[Int32]

Gets the value of the specified column as an instance of Object.

Item[String]

Gets the value of the specified column as an instance of Object.

RecordsAffected

Gets the number of rows changed, inserted, or deleted by execution of the SQL statement.

VisibleFieldCount

Gets the number of fields in the EntityDataReader that are not hidden.

Methods

Close()

Closes the EntityDataReader object.

CloseAsync()

Asynchronously closes the DbDataReader object.

(Inherited from DbDataReader)
CreateObjRef(Type)

Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.

(Inherited from MarshalByRefObject)
Dispose()

Releases all resources used by the current instance of the DbDataReader class.

(Inherited from DbDataReader)
Dispose(Boolean)

Releases the resources consumed by this EntityDataReader and calls Close().

DisposeAsync()

Asynchronously releases all resources used by the current instance of the DbDataReader class.

(Inherited from DbDataReader)
Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetBoolean(Int32)

Gets the value of the specified column as a Boolean.

GetByte(Int32)

Gets the value of the specified column as a byte.

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

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)

Gets the value of the specified column as a single character.

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

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)

This is the asynchronous version of GetColumnSchema(DbDataReader). Providers should override with an appropriate implementation. The cancellationToken can optionally be honored. The default implementation invokes the synchronous GetColumnSchema(DbDataReader) call and returns a completed task. The default implementation will return a cancelled task if passed an already cancelled cancellationToken. Exceptions thrown by GetColumnSchema(DbDataReader) will be communicated via the returned Task Exception property.

(Inherited from DbDataReader)
GetData(Int32)

Returns a nested data reader for the requested column.

(Inherited from DbDataReader)
GetDataReader(Int32)

Returns nested readers as DbDataReader objects.

GetDataRecord(Int32)

Returns a nested DbDataRecord.

GetDataTypeName(Int32)

Gets the name of the data type of the specified column.

GetDateTime(Int32)

Gets the value of the specified column as a DateTime object.

GetDbDataReader(Int32)

Returns a DbDataReader object for the requested column ordinal that can be overridden with a provider-specific implementation.

GetDecimal(Int32)

Gets the value of the specified column as a Decimal object.

GetDouble(Int32)

Gets the value of the specified column as a double-precision floating point number.

GetEnumerator()

Returns an IEnumerator that can be used to iterate through the rows in the data reader.

GetFieldType(Int32)

Gets the data type of the specified column.

GetFieldValue<T>(Int32)

Gets the value of the specified column as the requested type.

(Inherited from DbDataReader)
GetFieldValueAsync<T>(Int32, CancellationToken)

Asynchronously gets the value of the specified column as the requested type.

(Inherited from DbDataReader)
GetFieldValueAsync<T>(Int32)

Asynchronously gets the value of the specified column as the requested type.

(Inherited from DbDataReader)
GetFloat(Int32)

Gets the value of the specified column as a single-precision floating point number.

GetGuid(Int32)

Gets the value of the specified column as a globally-unique identifier (GUID).

GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetInt16(Int32)

Gets the value of the specified column as a 16-bit signed integer.

GetInt32(Int32)

Gets the value of the specified column as a 32-bit signed integer.

GetInt64(Int32)

Gets the value of the specified column as a 64-bit signed integer.

GetLifetimeService()
Obsolete.

Retrieves the current lifetime service object that controls the lifetime policy for this instance.

(Inherited from MarshalByRefObject)
GetName(Int32)

Gets the name of the column, given the zero-based column ordinal.

GetOrdinal(String)

Gets the column ordinal given the name of the column.

GetProviderSpecificFieldType(Int32)

Returns the provider-specific field type of the specified column.

GetProviderSpecificValue(Int32)

Gets the value of the specified column as an instance of Object.

GetProviderSpecificValues(Object[])

Gets all provider-specific attribute columns in the collection for the current row.

GetSchemaTable()

Returns a DataTable that describes the column metadata of the DbDataReader.

GetSchemaTableAsync(CancellationToken)

This is the asynchronous version of GetSchemaTable(). Providers should override with an appropriate implementation. The cancellationToken can optionally be honored. The default implementation invokes the synchronous GetSchemaTable() call and returns a completed task. The default implementation will return a cancelled task if passed an already cancelled cancellationToken. Exceptions thrown by GetSchemaTable() will be communicated via the returned Task Exception property.

(Inherited from DbDataReader)
GetStream(Int32)

Gets a stream to retrieve data from the specified column.

(Inherited from DbDataReader)
GetString(Int32)

Gets the value of the specified column as an instance of String.

GetTextReader(Int32)

Gets a text reader to retrieve data from the column.

(Inherited from DbDataReader)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
GetValue(Int32)

Gets the value of the specified column as an instance of Object.

GetValues(Object[])

Populates an array of objects with the column values of the current row.

InitializeLifetimeService()
Obsolete.

Obtains a lifetime service object to control the lifetime policy for this instance.

(Inherited from MarshalByRefObject)
IsDBNull(Int32)

Gets a value that indicates whether the column contains nonexistent or missing values.

IsDBNullAsync(Int32, CancellationToken)

Asynchronously gets a value that indicates whether the column contains non-existent or missing values.

(Inherited from DbDataReader)
IsDBNullAsync(Int32)

Asynchronously gets a value that indicates whether the column contains non-existent or missing values.

(Inherited from DbDataReader)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
MemberwiseClone(Boolean)

Creates a shallow copy of the current MarshalByRefObject object.

(Inherited from MarshalByRefObject)
NextResult()

Advances the reader to the next result when reading the results of a batch of statements.

NextResultAsync()

Asynchronously advances the reader to the next result when reading the results of a batch of statements.

(Inherited from DbDataReader)
NextResultAsync(CancellationToken)

Asynchronously advances the reader to the next result when reading the results of a batch of statements.

(Inherited from DbDataReader)
Read()

Advances the reader to the next record in a result set.

ReadAsync()

Asynchronously advances the reader to the next record in a result set.

(Inherited from DbDataReader)
ReadAsync(CancellationToken)

Asynchronously advances the reader to the next record in a result set.

(Inherited from DbDataReader)
ToString()

Returns a string that represents the current object.

(Inherited from Object)

Explicit Interface Implementations

IDataRecord.GetData(Int32)

For a description of this member, see GetData(Int32).

(Inherited from DbDataReader)

Extension Methods

CanGetColumnSchema(DbDataReader)

Gets a value that indicates whether a DbDataReader can get a column schema.

GetColumnSchema(DbDataReader)

Gets the column schema (DbColumn collection) for a DbDataReader.

Cast<TResult>(IEnumerable)

Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable)

Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable)

Enables parallelization of a query.

AsQueryable(IEnumerable)

Converts an IEnumerable to an IQueryable.

Applies to