EntityDataReader Class
Reads a forward-only stream of rows from a data source.
System::MarshalByRefObject
System.Data.Common::DbDataReader
System.Data.EntityClient::EntityDataReader
Assembly: System.Data.Entity (in System.Data.Entity.dll)
The EntityDataReader type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | DataRecordInfo | Gets DataRecordInfo for this IExtendedDataRecord. |
![]() | Depth | Gets a value indicating the depth of nesting for the current row. (Overrides DbDataReader::Depth.) |
![]() | FieldCount | Gets the number of columns in the current row. (Overrides DbDataReader::FieldCount.) |
![]() | HasRows | Gets a value that indicates whether this EntityDataReader contains one or more rows. (Overrides DbDataReader::HasRows.) |
![]() | IsClosed | Gets a value indicating whether the EntityDataReader is closed. (Overrides DbDataReader::IsClosed.) |
![]() | Item[Int32] | Gets the value of the specified column as an instance of Object. (Overrides DbDataReader::Item[Int32].) |
![]() | Item[String] | Gets the value of the specified column as an instance of Object. (Overrides DbDataReader::Item[String].) |
![]() | RecordsAffected | Gets the number of rows changed, inserted, or deleted by execution of the SQL statement. (Overrides DbDataReader::RecordsAffected.) |
![]() | VisibleFieldCount | Gets the number of fields in the EntityDataReader that are not hidden. (Overrides DbDataReader::VisibleFieldCount.) |
| Name | Description | |
|---|---|---|
![]() | Close | Closes the EntityDataReader object. (Overrides DbDataReader::Close().) |
![]() | CreateObjRef | 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. (Overrides DbDataReader::Dispose(Boolean).) |
![]() | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() | GetBoolean | Gets the value of the specified column as a Boolean. (Overrides DbDataReader::GetBoolean(Int32).) |
![]() | GetByte | Gets the value of the specified column as a byte. (Overrides DbDataReader::GetByte(Int32).) |
![]() | GetBytes | 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. (Overrides DbDataReader::GetBytes(Int32, Int64, array<Byte>, Int32, Int32).) |
![]() | GetChar | Gets the value of the specified column as a single character. (Overrides DbDataReader::GetChar(Int32).) |
![]() | GetChars | 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. (Overrides DbDataReader::GetChars(Int32, Int64, array<Char>, Int32, Int32).) |
![]() | GetData | Returns a DbDataReader object for the requested column ordinal. (Inherited from DbDataReader.) |
![]() | GetDataReader | Returns nested readers as DbDataReader objects. |
![]() | GetDataRecord | Returns a nested DbDataRecord. |
![]() | GetDataTypeName | Gets name of the data type of the specified column. (Overrides DbDataReader::GetDataTypeName(Int32).) |
![]() | GetDateTime | Gets the value of the specified column as a DateTime object. (Overrides DbDataReader::GetDateTime(Int32).) |
![]() | GetDbDataReader | Returns a DbDataReader object for the requested column ordinal that can be overridden with a provider-specific implementation. (Overrides DbDataReader::GetDbDataReader(Int32).) |
![]() | GetDecimal | Gets the value of the specified column as a Decimal object. (Overrides DbDataReader::GetDecimal(Int32).) |
![]() | GetDouble | Gets the value of the specified column as a double-precision floating point number. (Overrides DbDataReader::GetDouble(Int32).) |
![]() | GetEnumerator | Returns an IEnumerator that can be used to iterate through the rows in the data reader. (Overrides DbDataReader::GetEnumerator().) |
![]() | GetFieldType | Gets the data type of the specified column. (Overrides DbDataReader::GetFieldType(Int32).) |
![]() | GetFloat | Gets the value of the specified column as a single-precision floating point number. (Overrides DbDataReader::GetFloat(Int32).) |
![]() | GetGuid | Gets the value of the specified column as a globally-unique identifier (GUID). (Overrides DbDataReader::GetGuid(Int32).) |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetInt16 | Gets the value of the specified column as a 16-bit signed integer. (Overrides DbDataReader::GetInt16(Int32).) |
![]() | GetInt32 | Gets the value of the specified column as a 32-bit signed integer. (Overrides DbDataReader::GetInt32(Int32).) |
![]() | GetInt64 | Gets the value of the specified column as a 64-bit signed integer. (Overrides DbDataReader::GetInt64(Int32).) |
![]() | GetLifetimeService | Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from MarshalByRefObject.) |
![]() | GetName | Gets the name of the column, given the zero-based column ordinal. (Overrides DbDataReader::GetName(Int32).) |
![]() | GetOrdinal | Gets the column ordinal given the name of the column. (Overrides DbDataReader::GetOrdinal(String).) |
![]() | GetProviderSpecificFieldType | Returns the provider-specific field type of the specified column. (Overrides DbDataReader::GetProviderSpecificFieldType(Int32).) |
![]() | GetProviderSpecificValue | Gets the value of the specified column as an instance of Object. (Overrides DbDataReader::GetProviderSpecificValue(Int32).) |
![]() | GetProviderSpecificValues | Gets all provider-specific attribute columns in the collection for the current row. (Overrides DbDataReader::GetProviderSpecificValues(array<Object>).) |
![]() | GetSchemaTable | Returns a DataTable that describes the column metadata of the DbDataReader. (Overrides DbDataReader::GetSchemaTable().) |
![]() | GetString | Gets the value of the specified column as an instance of String. (Overrides DbDataReader::GetString(Int32).) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | GetValue | Gets the value of the specified column as an instance of Object. (Overrides DbDataReader::GetValue(Int32).) |
![]() | GetValues | Populates an array of objects with the column values of the current row. (Overrides DbDataReader::GetValues(array<Object>).) |
![]() | InitializeLifetimeService | Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from MarshalByRefObject.) |
![]() | IsDBNull | Gets a value that indicates whether the column contains nonexistent or missing values. (Overrides DbDataReader::IsDBNull(Int32).) |
![]() | 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. (Overrides DbDataReader::NextResult().) |
![]() | Read | Advances the reader to the next record in a result set. (Overrides DbDataReader::Read().) |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
| Name | Description | |
|---|---|---|
![]() ![]() | IDataRecord::GetData | For a description of this member, see IDataRecord::GetData. (Inherited from DbDataReader.) |
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:
EntityDataReader calls the DbDataReader::NextResult only when EntityDataReader::NextResult is explicitly called. If DbDataReader::NextResult throws an exeption, [EntityDataReader] will wrap it in EntityException (or a derived exception).
Close only closes the DbDataReader, without consuming any pending records or result sets.
Dispose() only disposes of the DbDataReader, without consuming any pending records or result sets.
For code examples, see Working with EntityClient.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
