Compartir a través de


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

Prepares the specified command on the data source to be executed; the command can 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

'Declaration
Public Function Prepare ( _
    command As String, _
    commandType As DataCommandType, _
    parameters As IVsDataParameter() _
) As String
public string Prepare(
    string command,
    DataCommandType commandType,
    IVsDataParameter[] parameters
)
public:
virtual String^ Prepare(
    String^ command, 
    DataCommandType commandType, 
    array<IVsDataParameter^>^ parameters
) sealed
abstract Prepare : 
        command:string * 
        commandType:DataCommandType * 
        parameters:IVsDataParameter[] -> string  
override Prepare : 
        command:string * 
        commandType:DataCommandType * 
        parameters:IVsDataParameter[] -> string
public final function Prepare(
    command : String, 
    commandType : DataCommandType, 
    parameters : IVsDataParameter[]
) : String

Parameters

  • command
    Type: System.String

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

Return Value

Type: System.String
An identifier of the prepared command that can later be passed to the Execute or ExecuteWithoutResults method by using the command type Prepared.

Implements

IVsDataCommand.Prepare(String, DataCommandType, array<IVsDataParameter[])

Exceptions

Exception Condition
ArgumentNullException

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

ArgumentOutOfRangeException

The commandTimeout parameter is less than -1.

Remarks

Other exceptions that occur indicate that the preparation failed for a provider-specified reason.

.NET Framework Security

See Also

Reference

DataCommand Class

Prepare Overload

Microsoft.VisualStudio.Data.Framework Namespace

DataCommand