Databases Reference
In-Depth Information
This code draws a grid with data returned from Analysis Services, as shown in Figure
33.14.
FIGURE 33.14
The Grid control displaying the result of the execution of the multidimen-
sional query.
Handling Object Symmetry
Objects contained in a CellSet object have similar interfaces and follow the same rules as
metadata objects; we call this object symmetry . A client application can retrieve some
classes of objects in two ways: by iterating the CellSet object and by iterating metadata
objects. For example, Hierarchy , Member , and MemberProperty objects can be retrieved as a
result of an MDX query or by navigating metadata objects. ADOMD.NET usually sends a
schema rowset request to request a metadata object. A schema rowset request generally
retrieves more information from the server then an MDX query.
Let's take the Hierarchy object as an example. It has properties such as Name , UniqueName ,
Description , HierarchyOrigin , and others. When the Hierarchy object is obtained by
iterating the metadata objects, its properties are populated from result of the execution of
an MDSCHEMA_HIERARCHIES schema rowset request. If the Hierarchy object is obtained as a
result of an MDX query, however, the object contains only its unique name. (See the
discussion of MDDataSet in Chapter 32.)
This raises a question: When the client application requests the Caption property of the
Hierarchy object, how does ADOMD.NET provide this information? ADOMD would
throw a NotImplemented exception, but ADOMD.NET is designed to solve the problem
and provide the client application with the information it requested. In our example,
ADOMD.NET will send an MDSCHEMA_HIERARCHIES request to the server if the schema is
not in the cache.
At first glance, this is very convenient for the programmer who creates the client applica-
tion, because she doesn't need to write complex code. On the other hand, an apparently
simple operation could lead to a round trip to the server. If performance is critical, try to
avoid calls to the following properties of the Hierarchy object:
.
Name
.
Description
Search WWH ::




Custom Search