DataCommand.Execute 方法 (String, DataCommandType, array<IVsDataParameter[])
執行指定的命令,並選擇性地使用參數且會傳回唯讀結果。
命名空間: Microsoft.VisualStudio.Data.Framework
組件: Microsoft.VisualStudio.Data.Framework (在 Microsoft.VisualStudio.Data.Framework.dll 中)
語法
'宣告
Public Function Execute ( _
command As String, _
commandType As DataCommandType, _
parameters As IVsDataParameter() _
) As IVsDataReader
public IVsDataReader Execute(
string command,
DataCommandType commandType,
IVsDataParameter[] parameters
)
public:
virtual IVsDataReader^ Execute(
String^ command,
DataCommandType commandType,
array<IVsDataParameter^>^ parameters
) sealed
abstract Execute :
command:string *
commandType:DataCommandType *
parameters:IVsDataParameter[] -> IVsDataReader
override Execute :
command:string *
commandType:DataCommandType *
parameters:IVsDataParameter[] -> IVsDataReader
public final function Execute(
command : String,
commandType : DataCommandType,
parameters : IVsDataParameter[]
) : IVsDataReader
參數
command
類型:String要針對資料來源執行的命令。
commandType
類型:Microsoft.VisualStudio.Data.Services.SupportEntities.DataCommandType指定如何解譯 command 參數的內容命令的型別。 命令型別可能是來自 DataCommandType 列舉的值或提供者所定義的自訂命令類型,可以強制從整數的轉型傳遞至 DataCommandType 列舉。
parameters
類型:array<Microsoft.VisualStudio.Data.Services.SupportEntities.IVsDataParameter[]陣列代表指定的命令類型之 IVsDataParameter 物件命令參數。
傳回值
類型:Microsoft.VisualStudio.Data.Services.SupportEntities.IVsDataReader
IVsDataReader 物件,提供從資料來源的順向,唯讀資料流。
實作
IVsDataCommand.Execute(String, DataCommandType, array<IVsDataParameter[])
例外狀況
例外狀況 | 條件 |
---|---|
ArgumentNullException | command 參數為 nullnull 參考 (即 Visual Basic 中的 Nothing)。 |
備註
任何,則傳回的 IVsDataReader 關閉之後,或在 parameters 陣列指定的傳回值參數 DataParameter 物件中擷取。 這是因為資料和參數值可由資料來源傳回之變更的命令。
![]() |
---|
發生表示執行的其他例外狀況為一個提供者指定的原因而失敗。 |
.NET Framework 安全性
- 完全信任立即呼叫者。這個成員無法供部分信任的程式碼使用。如需詳細資訊,請參閱從部分受信任程式碼使用程式庫。