DataCommand Class

 

Provides the ability to build and execute data commands of various types against data sources, and to retrieve read-only results or a command status code.

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


public abstract class DataCommand : DataSiteableObject<IVsDataConnection>, 
	IVsDataCommand

NameDescription
System_CAPS_protmethodDataCommand()

Initializes a new instance of the DataCommand class.

System_CAPS_protmethodDataCommand(IVsDataConnection)

Initializes a new instance of the DataCommand class together with a data connection object.

NameDescription
System_CAPS_pubpropertySite

Gets or sets the object site.(Inherited from DataSiteableObject<T>.)

NameDescription
System_CAPS_pubmethodCreateParameter()

Creates a parameter object that can be passed into the DeriveSchema, DeriveSchema, Execute, or ExecuteWithoutResults methods on a DataCommand instance.

System_CAPS_pubmethodDeriveParameters(String)

Derives the parameters that can be specified for a given command.

System_CAPS_pubmethodDeriveParameters(String, DataCommandType)

Derives the parameters that can be specified for a given command.

System_CAPS_pubmethodDeriveParameters(String, DataCommandType, Int32)

Derives the parameters that can be specified for a given command.

System_CAPS_pubmethodDeriveSchema(String)

Derives the schema returned from a specified command. The schema indicates the layout of items and blocks in a data reader.

System_CAPS_pubmethodDeriveSchema(String, DataCommandType)

Derives the schema returned from a specified command. The schema indicates the layout of items and blocks in a data reader.

System_CAPS_pubmethodDeriveSchema(String, DataCommandType, IVsDataParameter[])

Derives the schema returned from a specified command. The schema indicates the layout of items and blocks in a data reader.

System_CAPS_pubmethodDeriveSchema(String, DataCommandType, IVsDataParameter[], Int32)

Derives the schema returned from a specified command. The schema indicates the layout of items and blocks in a data reader.

System_CAPS_pubmethodEquals(Object)

(Inherited from Object.)

System_CAPS_pubmethodExecute(String)

Executes a specified command and returns read-only results.

System_CAPS_pubmethodExecute(String, DataCommandType)

Executes a specified command and returns read-only results.

System_CAPS_pubmethodExecute(String, DataCommandType, IVsDataParameter[])

Executes a specified command, optionally with parameters, and returns read-only results.

System_CAPS_pubmethodExecute(String, DataCommandType, IVsDataParameter[], Int32)

Executes a specified command, optionally with parameters, and returns read-only results.

System_CAPS_pubmethodExecuteWithoutResults(String)

Executes a command but does not request results, instead returning an integer indicating the outcome of the call.

System_CAPS_pubmethodExecuteWithoutResults(String, DataCommandType)

Executes a command but does not request results, instead returning an integer indicating the outcome of the call.

System_CAPS_pubmethodExecuteWithoutResults(String, DataCommandType, IVsDataParameter[])

Executes a command, optionally with parameters, but does not request results, instead returning an integer indicating the outcome of the call.

System_CAPS_pubmethodExecuteWithoutResults(String, DataCommandType, IVsDataParameter[], Int32)

Executes a command, optionally with parameters, but does not request results, instead returning an integer indicating the outcome of the call.

System_CAPS_protmethodFinalize()

(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

(Inherited from Object.)

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

(Inherited from Object.)

System_CAPS_protmethodOnSiteChanged(EventArgs)

Raises the SiteChanged event.(Inherited from DataSiteableObject<T>.)

System_CAPS_pubmethodPrepare(String)

Prepares the specified command on the data source to be executed; the command can then be executed multiple times, with varying parameters.

System_CAPS_pubmethodPrepare(String, DataCommandType)

Prepares the specified command on the data source to be executed; the command can then be executed multiple times, with varying parameters.

System_CAPS_pubmethodPrepare(String, DataCommandType, IVsDataParameter[])

Prepares the specified command on the data source to be executed; the command can then be executed multiple times, with varying parameters.

System_CAPS_pubmethodPrepare(String, DataCommandType, IVsDataParameter[], Int32)

Prepares the specified command on the data source to be executed; the command can then be executed multiple times, with varying parameters.

System_CAPS_pubmethodToString()

(Inherited from Object.)

NameDescription
System_CAPS_pubeventSiteChanged

Occurs when the Site property is changed.(Inherited from DataSiteableObject<T>.)

Data Designer Extensibility (DDEX) providers can execute various types of commands against a data source. This may include, but is not limited to, SQL statements, procedures, and function calls. They may also expose the ability to prepare and derive parameters and schemas for commands.

The DataCommand class introduces command types. A command type indicates a programmatic interpretation of a given command string. For example, a command type Text might notify the DDEX provider that the command string is a SQL statement that should be executed directly. Alternatively, a TabularFunction command type might notify the DDEX provider that the command string is the name of a table-valued function that should be executed by using the appropriate method.

Underlying technologies such as Open Database Connectivity (ODBC), OLE DB, and ADO.NET attempt to enumerate a set of allowed command types, typically as plain text, in table form, or as stored procedures. The DataCommand class extends this concept by relaxing the requirement that such a command type originate in a fixed enumeration. This provides flexibility by enabling DDEX providers to add custom command types, along with descriptions of how and when the commands can be used.

System_CAPS_noteNote

To provide command execution capability asynchronously, use the DataAsyncCommand class. This class has a set of methods that are equivalent to those on the DataCommand class, but these methods operate asynchronously.

Notes to Inheritors:

When you inherit from the DataCommand class, you must override each method from this class that is to be supported by its DDEX provider implementation. The base implementation of each method in this class throws a NotSupportedException.

Note that the ExecuteWithoutResults method has a base implementation that delegates to the Execute method.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: