Condividi tramite


Enumerating DDEX Data Object Types

The Visual Studio metadata engine, which drives object enumeration, must specify the name of the object type it wants to enumerate, as well as provide a set of filtering restrictions to apply to the enumeration call.

Object enumeration is performed by the SelectObjects method of the IVsDataObjectSelector service. You must specify this information for the object type by using the Service element under the Services element, setting the type equal to IVsDataObjectSelector and setting other properties such as the method name and parameters.

For example, when using the SQL Server Management Objects (SMO) enumerator, you have to convert the type and restrictions into a Universal Resource Name (URN). You can enable the object type to provide this information by adding an IVsDataObjectSelector service to the object type. For ADO.NET schema information, there must be a mapping from the data object type name to the underlying metadata collection name.

Enumeration Identifier and Properties

For the two most prevalent technologies, like ADO.NET, data is returned in the form of a standard result set (using DataSet or DataTable). The data object type allows each identifier part or property to specify the name of the underlying column that contains the data from the result set.

All data providers must expose results using an instance of the IVsDataReader class. For an enumeration of data objects, it is assumed there is a single result, and that each block of data in the result set contains identifier and property values indexed by name or integer. The data object type allows each identifier part or property to specify a name or index of an item in the data block that contains the specified data.

See Also

Concepts

Mapping Object Type Identifiers and Properties to Generic Types

Mapping Generic Restrictions to Datasource Requirements