Derives the parameters that can be specified for a given command.
Namespace: Microsoft.VisualStudio.Data.Framework
Assembly: Microsoft.VisualStudio.Data.Framework (in Microsoft.VisualStudio.Data.Framework.dll)
Syntax
'宣言
Public Overridable Function DeriveParameters ( _
command As String, _
commandType As DataCommandType, _
commandTimeout As Integer _
) As IVsDataParameter()
'使用
Dim instance As DataCommand
Dim command As String
Dim commandType As DataCommandType
Dim commandTimeout As Integer
Dim returnValue As IVsDataParameter()
returnValue = instance.DeriveParameters(command, _
commandType, commandTimeout)
public virtual IVsDataParameter[] DeriveParameters(
string command,
DataCommandType commandType,
int commandTimeout
)
public:
virtual array<IVsDataParameter^>^ DeriveParameters(
String^ command,
DataCommandType commandType,
int commandTimeout
)
public function DeriveParameters(
command : String,
commandType : DataCommandType,
commandTimeout : int
) : IVsDataParameter[]
Parameters
command
Type: System.StringA command from which to derive parameters 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.
commandTimeout
Type: System.Int32The length of time, in seconds, to block the client before canceling the parameter derivation and returning to the caller. A value of 0 indicates infinite time-out; a value of -1 indicates a provider default.
Return Value
Type: []
An array of IVsDataParameter objects. Each object represents a parameter derived from the command.
Implements
IVsDataCommand.DeriveParameters(String, DataCommandType, Int32)
Exceptions
| Exception | Condition |
|---|---|
| ArgumentNullException | The command parameter is a null reference (Nothing in Visual Basic). |
| ArgumentOutOfRangeException | The commandTimeout parameter is less than -1. |
Remarks
After the instances of the derived parameter objects are retrieved, the client owns them and can modify their values as needed. The client will then pass these values along with a command type set to Text and an appropriate time-out value to the Execute(String, DataCommandType, [], Int32) or [M:Microsoft.VisualStudio.Data.Framework.DataCommand.ExecuteWithoutResults(System.String,T:Microsoft.VisualStudio.Data.Services.SupportEntities.DataCommandType,Microsoft.VisualStudio.Data.Framework.DataParameter[],System.Int32)]
call.
注意
Other exceptions that occur indicate that the parameter derivation failed for a provider-specified reason.
Permissions
- 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.