DataCommand.Prepare Method (String, DataCommandType, array<IVsDataParameter , Int32)
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 Overridable Function Prepare ( _
command As String, _
commandType As DataCommandType, _
parameters As IVsDataParameter(), _
commandTimeout As Integer _
) As String
public virtual string Prepare(
string command,
DataCommandType commandType,
IVsDataParameter[] parameters,
int commandTimeout
)
public:
virtual String^ Prepare(
String^ command,
DataCommandType commandType,
array<IVsDataParameter^>^ parameters,
int commandTimeout
)
abstract Prepare :
command:string *
commandType:DataCommandType *
parameters:IVsDataParameter[] *
commandTimeout:int -> string
override Prepare :
command:string *
commandType:DataCommandType *
parameters:IVsDataParameter[] *
commandTimeout:int -> string
public function Prepare(
command : String,
commandType : DataCommandType,
parameters : IVsDataParameter[],
commandTimeout : int
) : String
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: 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[], 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
Other exceptions that occur indicate that the preparation 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.