Share via


DataCommand.Execute Method (String, DataCommandType, array<IVsDataParameter )

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 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

Parameters

  • command
    Type: System.String

    A command to execute that is specific to a data source.

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[])

Exceptions

Exception Condition
ArgumentNullException

The command parameter is nulla null reference (Nothing in Visual Basic).

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 execution failed for a provider-specified reason.

.NET Framework Security

See Also

Reference

DataCommand Class

Execute Overload

Microsoft.VisualStudio.Data.Framework Namespace

DataCommandType

ExecuteWithoutResults