DataCommand.Prepare 方法
準備資料來源之指定的順序執行,這個命令可能會執行多次,以變更的參數。
命名空間: Microsoft.VisualStudio.Data
組件: Microsoft.VisualStudio.Data (在 Microsoft.VisualStudio.Data.dll 中)
語法
'宣告
Public Overridable Function Prepare ( _
command As String, _
commandType As Integer, _
commandTimeout As Integer _
) As String
public virtual string Prepare(
string command,
int commandType,
int commandTimeout
)
public:
virtual String^ Prepare(
String^ command,
int commandType,
int commandTimeout
)
abstract Prepare :
command:string *
commandType:int *
commandTimeout:int -> string
override Prepare :
command:string *
commandType:int *
commandTimeout:int -> string
public function Prepare(
command : String,
commandType : int,
commandTimeout : int
) : String
參數
command
類型:String物件是針對資料來源執行的命令。
commandType
類型:Int32所表示之命令的命令類型,指定如何解譯 command 參數的內容。
commandTimeout
類型:Int32時間,以秒為單位),在執行取消和傳回之前封鎖用戶端給呼叫端。 值為 0 表示無限逾時;值為-1 表示預設提供者。
傳回值
類型:String
傳回使用命令類型 Prepared,稍後可以傳遞至或方法 ExecuteExecuteWithoutResults 準備的命令識別項。
例外狀況
例外狀況 | 條件 |
---|---|
ArgumentNullException | 命令或 asyncCommandEvents 是空的。 |
ArgumentException | commandType 指定無效的型別。 |
ArgumentOutOfRangeException | commandTimeout 小於-1。 |
NotSupportedException | 提供者不支援這個方法。 |
備註
發生的其他例外狀況表示參數衍生這個提供者所指定的原因而失敗。
.NET Framework 安全性
- 完全信任立即呼叫者。這個成員無法供部分信任的程式碼使用。如需詳細資訊,請參閱從部分受信任程式碼使用程式庫。