Compartir a través de


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
Assembly:  Microsoft.VisualStudio.Data (in Microsoft.VisualStudio.Data.dll)

Syntax

<GuidAttribute("E19F79F4-3219-423d-97A4-5A2B8A8F45F3")> _
Public MustInherit Class DataCommand

Dim instance As DataCommand
[GuidAttribute("E19F79F4-3219-423d-97A4-5A2B8A8F45F3")]
public abstract class DataCommand
[GuidAttribute(L"E19F79F4-3219-423d-97A4-5A2B8A8F45F3")]
public ref class DataCommand abstract
public abstract class DataCommand

Remarks

DDEX Providers can execute various types of commands against the 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 the concept of a command type. A command type indicates a programmatic interpretation of a given command string. For example, a command type "Text" might tell the DDEX provider that the command string is a SQL statement that should be executed directly. On the other hand, a "TabularFunction" command type might tell the DDEX provider that the command string is the name of a table-valued function that should be executed using the appropriate method.

Underlying technologies like ODBC, OLE DB, and ADO.NET attempt to enumerate a set of allowable 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 enormous flexibility by allowing DDEX providers to add custom command types, including descriptions of how and when the commands can be used.

Nota

To provide command execution capability, but asynchronously, use the DataAsyncCommandclass, which has a set of methods equivalent to those on the DataCommand class, but which operate asynchronously.

Classes derived from the DataCommand class should implement those methods that are supported by their DDEX provider implementation. The base implementation of each method simply throws a NotSupportedException.

Inheritance Hierarchy

System.Object
  Microsoft.VisualStudio.Data.DataCommand

Thread Safety

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

See Also

Reference

DataCommand Members

Microsoft.VisualStudio.Data Namespace

DataCommandType