共用方式為


DataCommand.DeriveParameters 方法

取得可為指定的命令中指定的參數。

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

語法

'宣告
Public Overridable Function DeriveParameters ( _
    command As String, _
    commandType As Integer, _
    commandTimeout As Integer _
) As DataParameter()
public virtual DataParameter[] DeriveParameters(
    string command,
    int commandType,
    int commandTimeout
)
public:
virtual array<DataParameter^>^ DeriveParameters(
    String^ command, 
    int commandType, 
    int commandTimeout
)
abstract DeriveParameters : 
        command:string * 
        commandType:int * 
        commandTimeout:int -> DataParameter[] 
override DeriveParameters : 
        command:string * 
        commandType:int * 
        commandTimeout:int -> DataParameter[] 
public function DeriveParameters(
    command : String, 
    commandType : int, 
    commandTimeout : int
) : DataParameter[]

參數

  • command
    型別:System.String
    的命令以取得參數的特定資料來源。
  • commandType
    型別:System.Int32
    所表示之命令的命令類型,指定如何解譯 command 參數的內容。
  • commandTimeout
    型別:System.Int32
    時間,以秒為單位),在移除參數衍生並傳回之前封鎖用戶端給呼叫端。值為 0 表示無限逾時;值為-1 表示預設提供者。

傳回值

型別:array<Microsoft.VisualStudio.Data.DataParameter[]
傳回物件陣列 DataParameter 物件。每個物件表示從命令衍生自類別的參數。

例外狀況

例外狀況 條件
ArgumentNullException

命令或 asyncCommandEvents 是空的。

ArgumentException

commandType 指定無效的型別。

ArgumentOutOfRangeException

commandTimeout 小於-1。

NotSupportedException

提供者不支援這個方法。

備註

一旦取得的參數物件的執行個體擷取,用戶端擁有它們可以修改其值視需要;用戶端會將這些值傳遞至 Execute

或者 ExecuteWithoutResults

呼叫。

注意事項注意事項

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

.NET Framework 安全性

請參閱

參考

DataCommand 類別

Microsoft.VisualStudio.Data 命名空間

CreateParameter