AdoDotNetConnectionSupport.Execute Method

Executes a specified command, optionally with parameters, and returns results as a DataReader object.

Namespace:  Microsoft.VisualStudio.Data.AdoDotNet
Assembly:  Microsoft.VisualStudio.Data (in Microsoft.VisualStudio.Data.dll)

Syntax

'宣言
Public Overridable Function Execute ( _
    command As String, _
    commandType As Integer, _
    parameters As DataParameter(), _
    commandTimeout As Integer _
) As DataReader
'使用
Dim instance As AdoDotNetConnectionSupport
Dim command As String
Dim commandType As Integer
Dim parameters As DataParameter()
Dim commandTimeout As Integer
Dim returnValue As DataReader

returnValue = instance.Execute(command, _
    commandType, parameters, commandTimeout)
public virtual DataReader Execute(
    string command,
    int commandType,
    DataParameter[] parameters,
    int commandTimeout
)
public:
virtual DataReader^ Execute(
    String^ command, 
    int commandType, 
    array<DataParameter^>^ parameters, 
    int commandTimeout
)
public function Execute(
    command : String, 
    commandType : int, 
    parameters : DataParameter[], 
    commandTimeout : int
) : DataReader

Parameters

  • command
    Type: System.String

    Command to execute that is specific to the data source.

  • commandType
    Type: System.Int32

    Type of the indicated command, specifying how to interpret the contents of the command parameter.

  • parameters
    Type: []

    Array of DataParameter object for the specified command type.

  • commandTimeout
    Type: System.Int32

    Length of time, in seconds, to block the client before canceling the schema derivation and returning to the caller. A value of zero indicates infinite timeout; value of -1 indicates a provider default.

Return Value

Type: Microsoft.VisualStudio.Data.DataReader

Returns a DataParameter object, which provides a forward-only, read-only stream from the data source.

Remarks

Due to varying orders in which data and parameter values can be returned by a data source, any out or return value parameters specified in the parameters array of DataParameter objects can be retrieved only after the returned DataReader has been closed.

Permissions

See Also

Reference

AdoDotNetConnectionSupport Class

AdoDotNetConnectionSupport Members

Microsoft.VisualStudio.Data.AdoDotNet Namespace