DataCommand.Execute Method (String, DataCommandType, array<IVsDataParameter , Int32)
Executes a specified command, optionally with parameters, and returns read-only results.
Namespace: Microsoft.VisualStudio.Data.Framework
Assembly: Microsoft.VisualStudio.Data.Framework (in Microsoft.VisualStudio.Data.Framework.dll)
Syntax
'Declaration
Public Overridable Function Execute ( _
command As String, _
commandType As DataCommandType, _
parameters As IVsDataParameter(), _
commandTimeout As Integer _
) As IVsDataReader
public virtual IVsDataReader Execute(
string command,
DataCommandType commandType,
IVsDataParameter[] parameters,
int commandTimeout
)
public:
virtual IVsDataReader^ Execute(
String^ command,
DataCommandType commandType,
array<IVsDataParameter^>^ parameters,
int commandTimeout
)
abstract Execute :
command:string *
commandType:DataCommandType *
parameters:IVsDataParameter[] *
commandTimeout:int -> IVsDataReader
override Execute :
command:string *
commandType:DataCommandType *
parameters:IVsDataParameter[] *
commandTimeout:int -> IVsDataReader
public function Execute(
command : String,
commandType : DataCommandType,
parameters : IVsDataParameter[],
commandTimeout : int
) : IVsDataReader
Parameters
command
Type: System.StringA command to execute that is specific to a data source.
commandType
Type: Microsoft.VisualStudio.Data.Services.SupportEntities.DataCommandTypeThe type of the command that specifies how to interpret the contents of the command parameter. The command type could either be a value from the DataCommandType enumeration or a custom command type defined by a provider, which can be passed in by forcing a cast from an integer to the DataCommandType enumeration.
parameters
Type: array<Microsoft.VisualStudio.Data.Services.SupportEntities.IVsDataParameter[]An array of IVsDataParameter objects representing the command parameters for the specified command type.
commandTimeout
Type: System.Int32The length of time, in seconds, to block the client before canceling the execution and returning to the caller. A value of 0 indicates infinite time-out; a value of -1 indicates a provider default.
Return Value
Type: Microsoft.VisualStudio.Data.Services.SupportEntities.IVsDataReader
An IVsDataReader object, which provides a forward-only, read-only stream from the data source.
Implements
IVsDataCommand.Execute(String, DataCommandType, array<IVsDataParameter[], Int32)
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | The command parameter is nulla null reference (Nothing in Visual Basic). |
ArgumentOutOfRangeException | The commandTimeout parameter is less than -1. |
Remarks
Any out or return value parameters specified in the parameters array of DataParameter objects can be retrieved only after the returned IVsDataReader has been closed. This is because of varying orders in which data and parameter values can be returned by a data source.
Note
Other exceptions that occur indicate that the parameter derivation failed for a provider-specified reason.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.