共用方式為


DataReader 類別

提供了公開所有資料來源的資料。

繼承階層架構

System.Object
  Microsoft.VisualStudio.Data.Framework.DataReader
    Microsoft.VisualStudio.Data.Framework.AdoDotNet.AdoDotNetReader
    Microsoft.VisualStudio.Data.Framework.AdoDotNet.AdoDotNetSchemaReader
    Microsoft.VisualStudio.Data.Framework.AdoDotNet.AdoDotNetTableReader

命名空間:  Microsoft.VisualStudio.Data.Framework
組件:  Microsoft.VisualStudio.Data.Framework (在 Microsoft.VisualStudio.Data.Framework.dll 中)

語法

'宣告
Public MustInherit Class DataReader _
    Implements IVsDataReader, IDisposable, IVsDataReaderDescriptor
public abstract class DataReader : IVsDataReader, 
    IDisposable, IVsDataReaderDescriptor
public ref class DataReader abstract : IVsDataReader, 
    IDisposable, IVsDataReaderDescriptor
[<AbstractClass>]
type DataReader =  
    class
        interface IVsDataReader
        interface IDisposable
        interface IVsDataReaderDescriptor
    end
public abstract class DataReader implements IVsDataReader, IDisposable, IVsDataReaderDescriptor

DataReader 型別會公開下列成員。

建構函式

  名稱 說明
受保護的方法 DataReader 初始化 DataReader 類別的新執行個體。

回頁首

屬性

  名稱 說明
公用屬性 Descriptor 取得描述資料來源之資料的相關資訊。
受保護的屬性 HasDescriptor 取得表示資料讀取器是否通過 Descriptor 屬性公開其 IVsDataReaderDescriptor 實作。
公用屬性 IsClosed 取得的 Boolean 值指定的讀取器是否關閉。
公用屬性 ItemCount 取得集合中的項目數目是目前的資料區塊。
公用屬性 Status 取得一個數字狀態碼傳回以目前提供資料的方法將資料讀取器。

回頁首

方法

  名稱 說明
公用方法 Close 關閉 DataReader 執行個體。
公用方法 Dispose() 釋放 Managed 資源。 DataReader 目前執行個體所使用的。
受保護的方法 Dispose(Boolean) 清除資源與目前執行個體 DataReader ,兩個公用 Dispose ,當呼叫方法時,和,當物件完成時呼叫 Finalize 方法時。
公用方法 Equals 判斷指定的物件是否等於目前物件。 (繼承自 Object)。
受保護的方法 Finalize DataReader 完成目前的執行個體。 (覆寫 Object.Finalize()。)
公用方法 GetBytes(Int32, array<Byte[], Int32, Int32) 擷取所指定的位元組數未經處理的二進位資料。
公用方法 GetBytes(String, array<Byte[], Int32, Int32) 擷取所指定的位元組數未經處理的二進位資料。
公用方法 GetHashCode 做為特定型別的雜湊函式。 (繼承自 Object)。
公用方法 GetItem(Int32) 擷取項目的值會在目前的資料區塊的指定索引處的。
公用方法 GetItem(String) 擷取一個資料項目的值具有指定名稱的資料目前的區塊。
公用方法 GetItemIndex 傳回索引以資料區塊的指定項目名稱對應。
公用方法 GetItemMaxLength 會擷取最大長度,以字元為單位),該資料項目在指定之索引處的。
公用方法 GetItemName 擷取這個名稱指派給資料項目在指定索引處,,如果有的話。
公用方法 GetItemType(Int32) 擷取資料項目或項目的資料型別,在預設格式的 Default指定索引處的。
公用方法 GetItemType(Int32, DataItemTypeFormat) 擷取資料項目或項目的資料型別,在中指定之格式的指定索引處的。
公用方法 GetType 取得目前執行個體的 Type。 (繼承自 Object)。
公用方法 IsNullItem(Int32) 表示在指定之索引上的資料項目是未指定的,也就是說, nullNull 參照 (即 Visual Basic 中的 Nothing)。
公用方法 IsNullItem(String) 表示指定之資料項目的值是未指定的,也就是說, nullNull 參照 (即 Visual Basic 中的 Nothing)。
受保護的方法 MemberwiseClone 建立目前 Object 的淺層複本 (Shallow Copy)。 (繼承自 Object)。
公用方法 NextResult 在讀取器包含多個結果集時,資料讀取器前進到設定的下一個結果。
公用方法 Read 在讀取器包含超過資料時,區塊會使讀取器前進至下一個資料區塊。
公用方法 Terminate 立即結束資料讀取器,,不需傳回任何資料或設定輸出參數。
公用方法 ToString 傳回表示目前物件的字串。 (繼承自 Object)。

回頁首

備註

所有基底層級資料擷取機制 DataReader 傳回物件。

執行緒安全

這個型別的任何 Public static (在 Visual Basic 中為 Shared) 成員都具備執行緒安全。不保證任何執行個體成員是安全執行緒。

請參閱

參考

Microsoft.VisualStudio.Data.Framework 命名空間

AdoDotNetDataReader