共用方式為


IVsDataCommand.DeriveSchema 方法 (String, DataCommandType)

當由類別實作時,從指定的命令取得傳回的結構描述。 結構描述的項目和區塊的配置資料讀取器。

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

語法

'宣告
Function DeriveSchema ( _
    command As String, _
    commandType As DataCommandType _
) As IVsDataReader
IVsDataReader DeriveSchema(
    string command,
    DataCommandType commandType
)
IVsDataReader^ DeriveSchema(
    String^ command, 
    DataCommandType commandType
)
abstract DeriveSchema : 
        command:string * 
        commandType:DataCommandType -> IVsDataReader
function DeriveSchema(
    command : String, 
    commandType : DataCommandType
) : IVsDataReader

參數

  • command
    類型:String

    命令可以取得與資料來源的結構描述。

傳回值

類型:Microsoft.VisualStudio.Data.Services.SupportEntities.IVsDataReader
IVsDataReader 物件。這個物件提供讀取器物件提供說明項目和區塊,也就是說,結構描述設定的順向、唯讀,資料流,傳回在執行指定的命令。

備註

資料讀取器的結構描述中傳回必須由這個方法會遵循特定格式。 對於要傳回的每個結果,當您執行命令,則應該在資料讀取器的單一結果。 這些結果都應該包含描述項目中傳回的區塊,讓您在執行命令時。 這個描述應該包含下列項目:

  • 名稱 (字串):項目的名稱。

  • 序數 (Int32):項目的位置。

  • UserDataType (字串):項目 (例如, 「myType」) 的使用者資料型別。

  • NativeDataType (字串):項目的原生資料型別 (例如, 「、」)。

  • ProviderDataType (Int32):項目 (例如,) System.Data.DbType.StringFixedLength 提供者的資料型別。

  • FrameworkDataType (型別):項目 (例如, System.Int32) 架構的資料型別。

  • 長度 (Int32):項目的最大長度,如果適用的話)。

  • 精確度 (Int32):項目的精確度, (如果可能的話)。

  • 縮放 (Int32):項目的比例,如果適用的話)。

  • 可為 Null (布林值):項目的 Null 屬性。

提供者不支援這類的項目 (例如,資料型別的某些形式的) 應該存在,但是設定為 nullnull 參考 (即 Visual Basic 中的 Nothing)。

注意事項注意事項

發生的其他例外狀況表示參數衍生這個提供者所指定的原因而失敗。

.NET Framework 安全性

請參閱

參考

IVsDataCommand 介面

DeriveSchema 多載

Microsoft.VisualStudio.Data.Services.SupportEntities 命名空間