DataAsyncCommand.PrepareAsync Method

Prepares, in an asynchronous manner, the specified command to be executed against the data source; the command may then be executed multiple times, with varying parameters.

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

Syntax

'宣言
Public Sub PrepareAsync ( _
    command As String, _
    commandType As DataCommandType, _
    parameters As IVsDataParameter(), _
    commandTimeout As Integer, _
    userState As Object _
)
'使用
Dim instance As DataAsyncCommand
Dim command As String
Dim commandType As DataCommandType
Dim parameters As IVsDataParameter()
Dim commandTimeout As Integer
Dim userState As Object

instance.PrepareAsync(command, commandType, _
    parameters, commandTimeout, userState)
public void PrepareAsync(
    string command,
    DataCommandType commandType,
    IVsDataParameter[] parameters,
    int commandTimeout,
    Object userState
)
public:
virtual void PrepareAsync(
    String^ command, 
    DataCommandType commandType, 
    array<IVsDataParameter^>^ parameters, 
    int commandTimeout, 
    Object^ userState
) sealed
public final function PrepareAsync(
    command : String, 
    commandType : DataCommandType, 
    parameters : IVsDataParameter[], 
    commandTimeout : int, 
    userState : Object
)

Parameters

  • parameters
    Type: []

    An array of IVsDataParameter objects as command parameters.

  • commandTimeout
    Type: System.Int32

    Amount of time, in seconds, before which the command times out.

  • userState
    Type: System.Object

    The object on which this method calls back as the command progresses.

Implements

IVsDataAsyncCommand.PrepareAsync(String, DataCommandType, [], Int32, Object)

Remarks

This method performs the same operation as the Prepare method, but in an asynchronous manner.

If the value of the commandTimeout parameter is 0, there is no timeout (or, timeout is infinite); if the value is -1, the timeout period is that set by the data provider.

The userState parameter uniquely identifies the specific asynchronous operation and is passed back as part of the event arguments for the DeriveParametersCompleted event so that a listener can determine which asynchronous process completed.

Permissions

See Also

Reference

DataAsyncCommand Class

DataAsyncCommand Members

Microsoft.VisualStudio.Data.Framework Namespace

DataCommand