共用方式為


EntityDataReader 類別

[此頁面專屬於 Entity Framework 第 6 版。最新版本可從 'Entity Framework' NuGet 套件取得。如需 Entity Framework 的詳細資訊,請參閱 msdn.com/data/ef。]

實體用戶端提供者的資料讀取器類別

繼承階層

System.Object
  System.MarshalByRefObject
    System.Data.Common.DbDataReader
      System.Data.Entity.Core.EntityClient.EntityDataReader

命名空間:  System.Data.Entity.Core.EntityClient
組件:  EntityFramework (在 EntityFramework.dll 中)

語法

'宣告
<DefaultMemberAttribute("Item")> _
<SuppressMessageAttribute("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix")> _
<SuppressMessageAttribute("Microsoft.Design", "CA1010:CollectionsShouldImplementGenericInterface")> _
Public Class EntityDataReader _
    Inherits DbDataReader _
    Implements IExtendedDataRecord, IDataRecord
'用途
Dim instance As EntityDataReader
[DefaultMemberAttribute("Item")]
[SuppressMessageAttribute("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix")]
[SuppressMessageAttribute("Microsoft.Design", "CA1010:CollectionsShouldImplementGenericInterface")]
public class EntityDataReader : DbDataReader, 
    IExtendedDataRecord, IDataRecord
[DefaultMemberAttribute(L"Item")]
[SuppressMessageAttribute(L"Microsoft.Naming", L"CA1710:IdentifiersShouldHaveCorrectSuffix")]
[SuppressMessageAttribute(L"Microsoft.Design", L"CA1010:CollectionsShouldImplementGenericInterface")]
public ref class EntityDataReader : public DbDataReader, 
    IExtendedDataRecord, IDataRecord
[<DefaultMemberAttribute("Item")>]
[<SuppressMessageAttribute("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix")>]
[<SuppressMessageAttribute("Microsoft.Design", "CA1010:CollectionsShouldImplementGenericInterface")>]
type EntityDataReader =  
    class 
        inherit DbDataReader 
        interface IExtendedDataRecord 
        interface IDataRecord 
    end
public class EntityDataReader extends DbDataReader implements IExtendedDataRecord, IDataRecord

EntityDataReader 類型會公開下列成員。

屬性

  名稱 描述
公用屬性 DataRecordInfo 取得此 IExtendedDataRecordDataRecordInfo
公用屬性 Depth 取得值,表示目前資料列的巢狀深度。 (覆寫 DbDataReader.Depth。)
公用屬性 FieldCount 取得目前資料列中的資料行數目。 (覆寫 DbDataReader.FieldCount。)
公用屬性 HasRows 取得表示此 EntityDataReader 是否包含一或多個資料列的值。 (覆寫 DbDataReader.HasRows。)
公用屬性 IsClosed 取得值,表示 EntityDataReader 是否關閉。 (覆寫 DbDataReader.IsClosed。)
公用屬性 Item[Int32] 取得所指定資料行的值,做為 Object 的執行個體。 (覆寫 DbDataReader.Item[Int32]。)
公用屬性 Item[String] 取得所指定資料行的值,做為 Object 的執行個體。 (覆寫 DbDataReader.Item[String]。)
公用屬性 RecordsAffected 取得因執行 SQL 陳述式所變更、插入或刪除的資料列數目。 (覆寫 DbDataReader.RecordsAffected。)
公用屬性 VisibleFieldCount 取得 EntityDataReader 中沒有隱藏的欄位數。 (覆寫 DbDataReader.VisibleFieldCount。)

靠上

方法

  名稱 描述
公用方法 Close 關閉 EntityDataReader 物件。 (覆寫 DbDataReader.Close()。)
公用方法 CreateObjRef 安全性關鍵。 (繼承自 MarshalByRefObject)。
公用方法 Dispose() (繼承自 DbDataReader)。
受保護的方法 Dispose(Boolean) 釋放此 EntityDataReader 所耗用的資源並呼叫 Close()。 (覆寫 DbDataReader.Dispose(Boolean)。)
公用方法 Equals (繼承自 Object)。
受保護的方法 Finalize (繼承自 Object)。
公用方法 GetBoolean 取得指定之資料行的值做為布林值 (Boolean)。 (覆寫 DbDataReader.GetBoolean(Int32)。)
公用方法 GetByte 取得指定資料行的值做為位元組。 (覆寫 DbDataReader.GetByte(Int32)。)
公用方法 GetBytes 將位元組資料流從指定的資料行 (從 dataIndex 代表的位置開始) 讀取到緩衝區 (從 bufferIndex 代表的位置開始)。 (覆寫 DbDataReader.GetBytes(Int32, Int64, Byte[], Int32, Int32)。)
公用方法 GetChar 取得指定的資料行值做為單一字元。 (覆寫 DbDataReader.GetChar(Int32)。)
公用方法 GetChars 將字元資料流從指定的資料行 (從 dataIndex 代表的位置開始) 讀取到緩衝區 (從 bufferIndex 代表的位置開始)。 (覆寫 DbDataReader.GetChars(Int32, Int64, Char[], Int32, Int32)。)
公用方法 GetData (繼承自 DbDataReader)。
公用方法 GetDataReader 傳回巢狀讀取器做為 DbDataReader 物件。
公用方法 GetDataRecord 傳回巢狀 DbDataRecord
公用方法 GetDataTypeName 取得指定資料行的資料類型名稱。 (覆寫 DbDataReader.GetDataTypeName(Int32)。)
公用方法 GetDateTime 取得指定之資料行的值做為 DateTime 物件。 (覆寫 DbDataReader.GetDateTime(Int32)。)
受保護的方法 GetDbDataReader 傳回所要求資料行序數的 DbDataReader 物件,可使用提供者特定的實作 (Implementation) 覆寫。 (覆寫 DbDataReader.GetDbDataReader(Int32)。)
公用方法 GetDecimal 取得指定之資料行的值做為 Decimal 物件。 (覆寫 DbDataReader.GetDecimal(Int32)。)
公用方法 GetDouble 取得指定資料行的值做為雙精確度浮點數。 (覆寫 DbDataReader.GetDouble(Int32)。)
公用方法 GetEnumerator 傳回 IEnumerator,可用來逐一查看資料讀取器中的資料列。 (覆寫 DbDataReader.GetEnumerator()。)
公用方法 GetFieldType 取得指定資料行的資料類型。 (覆寫 DbDataReader.GetFieldType(Int32)。)
公用方法 GetFieldValue``1 (繼承自 DbDataReader)。
公用方法 GetFieldValueAsync``1(Int32) (繼承自 DbDataReader)。
公用方法 GetFieldValueAsync``1(Int32, CancellationToken) (繼承自 DbDataReader)。
公用方法 GetFloat 取得指定資料行的值做為單精確度浮點數。 (覆寫 DbDataReader.GetFloat(Int32)。)
公用方法 GetGuid 取得指定資料行的值做為全域唯一識別項 (GUID)。 (覆寫 DbDataReader.GetGuid(Int32)。)
公用方法 GetHashCode (繼承自 Object)。
公用方法 GetInt16 取得指定資料行的值做為 16 位元帶正負號的整數 (Signed Integer)。 (覆寫 DbDataReader.GetInt16(Int32)。)
公用方法 GetInt32 取得指定資料行的值做為 32 位元帶正負號的整數 (Signed Integer)。 (覆寫 DbDataReader.GetInt32(Int32)。)
公用方法 GetInt64 取得指定資料行的值做為 64 位元帶正負號的整數 (Signed Integer)。 (覆寫 DbDataReader.GetInt64(Int32)。)
公用方法 GetLifetimeService 安全性關鍵。 (繼承自 MarshalByRefObject)。
公用方法 GetName 在已知以零為基底的資料行序數的情況下,取得資料行的名稱。 (覆寫 DbDataReader.GetName(Int32)。)
公用方法 GetOrdinal 在已知資料行名稱的情況下,取得資料行序數。 (覆寫 DbDataReader.GetOrdinal(String)。)
公用方法 GetProviderSpecificFieldType 傳回指定資料行的提供者特定的欄位類型 (Field Type)。 (覆寫 DbDataReader.GetProviderSpecificFieldType(Int32)。)
公用方法 GetProviderSpecificValue 取得所指定資料行的值,做為 Object 的執行個體。 (覆寫 DbDataReader.GetProviderSpecificValue(Int32)。)
公用方法 GetProviderSpecificValues 為目前的資料列在集合中取得所有提供者特定的屬性資料行。 (覆寫 DbDataReader.GetProviderSpecificValues(Object[])。)
公用方法 GetSchemaTable 傳回 DataTable,以描述 DbDataReader 的資料行中繼資料。 (覆寫 DbDataReader.GetSchemaTable()。)
公用方法 GetStream (繼承自 DbDataReader)。
公用方法 GetString 取得所指定資料行的值,做為 String 的執行個體。 (覆寫 DbDataReader.GetString(Int32)。)
公用方法 GetTextReader (繼承自 DbDataReader)。
公用方法 GetType (繼承自 Object)。
公用方法 GetValue 取得所指定資料行的值,做為 Object 的執行個體。 (覆寫 DbDataReader.GetValue(Int32)。)
公用方法 GetValues 使用目前資料列的資料行值填入物件陣列。 (覆寫 DbDataReader.GetValues(Object[])。)
公用方法 InitializeLifetimeService 安全性關鍵。 (繼承自 MarshalByRefObject)。
公用方法 IsDBNull 取得值,此值表示資料行是否包含不存在或遺漏的值。 (覆寫 DbDataReader.IsDBNull(Int32)。)
公用方法 IsDBNullAsync(Int32) (繼承自 DbDataReader)。
公用方法 IsDBNullAsync(Int32, CancellationToken) (繼承自 DbDataReader)。
受保護的方法 MemberwiseClone() (繼承自 Object)。
受保護的方法 MemberwiseClone(Boolean) (繼承自 MarshalByRefObject)。
公用方法 NextResult 在讀取陳述式批次的結果時,會將讀取器向前移到下一個結果。 (覆寫 DbDataReader.NextResult()。)
公用方法 NextResultAsync (繼承自 DbDataReader)。
公用方法 NextResultAsync(CancellationToken) 在讀取陳述式批次時,以非同步方式將讀取器向前移到下一個結果集 (覆寫 DbDataReaderNextResultAsync(CancellationToken)。)
公用方法 Read 將讀取器向前移到結果集中的下一個資料錄。 (覆寫 DbDataReader.Read()。)
公用方法 ReadAsync (繼承自 DbDataReader)。
公用方法 ReadAsync(CancellationToken) 以非同步方式將讀取器移至目前結果集的下一個資料列 (覆寫 DbDataReaderReadAsync(CancellationToken)。)
公用方法 ToString (繼承自 Object)。

靠上

明確介面實作

  名稱 描述
明確介面實作私用方法 IDataRecord.GetData (繼承自 DbDataReader)。

靠上

執行緒安全

這個類型的任何 Public static (在 Visual Basic 中為 Shared) 成員都是安全執行緒。並非所有的執行個體成員都是安全執行緒。

請參閱

參考

System.Data.Entity.Core.EntityClient 命名空間