ADOMD.NET Client Programming
Applies To: SQL Server 2016 Preview
The ADOMD.NET client components reside within the Microsoft.AnalysisServices.AdomdClient namespace (in microsoft.analysisservices.adomdclient.dll). These client components provide the functionality for client and middle-tier applications to easily query data and metadata from an analytical data store, such as Microsoft SQL Server Analysis Services.
In querying an analytical data source, there are a set of common tasks that need to be performed. The following table represents the common tasks in which you use the ADOMD.NET client objects to perform such a query.
|Establishing Connections in ADOMD.NET||In ADOMD.NET, you use an AdomdConnection object to establish connections with analytical data sources, such as Analysis Services databases. You can use the AdomdConnection object to run commands, retrieve data, and retrieve metadata from the analytical data source.|
|Retrieving Metadata from an Analytical Data Source||After a connection has been established, you can use a wide variety of objects to retrieve information about the underlying data source. This functionality allows applications to adapt to the data source to which they have connected.|
|Executing Commands Against an Analytical Data Source||The AdomdCommand object provides the interfaces necessary for running commands against the underlying analytical data source.|
|Retrieving Data from an Analytical Data Source||After a command runs, data could be retrieved and parsed using either the CellSet, AdomdDataReader, or System.XmlReader objects.|
|Performing Transactions in ADOMD.NET||All of the actions listed in the previous rows of this table can take place within a read-committed transaction, in which shared locks are held while the data is being read to avoid dirty reads. The data can still be changed before the end of the transaction, resulting in non-repeatable reads or phantom data. The AdomdTransaction object provides the transaction functionality in ADOMD.NET.|
Interaction with the ADOMD.NET object hierarchy typically starts with one or more of the objects in the topmost layer, as described in the following table.
|To||Use this object|
|Connect to an analytical data source||AdomdConnection|
The AdomdConnection object represents both a connection to a data source and the data source metadata. For example, you can connect to a Microsoft SQL Server Analysis Services local cube (.cub) file, and then examine the Cubes property to obtain metadata about the cubes present on the analytical data source. This object also represents the implementation of the IDbConnection interface, an interface that is required by all .NET Framework data providers.
|Discover the data mining capabilities of the data source||AdomdConnection|
The AdomdConnection object exposes several mining collections:
The MiningModelCollection contains a list of every mining model in the data source.
The MiningServiceCollection provides information about the available mining algorithms.
The MiningStructureCollection exposes information about the mining structures on the server.
|Query the data source||AdomdCommand|
The AdomdCommand object represents the statement or query that will be sent to the server. Once a connection is established to a data source, you use a AdomdCommand object to run statements in the supported language, such as Multidimensional Expressions (MDX) or Data Mining Data Mining Extensions (DMX). You can also use a AdomdCommand object to return results in the form of CellSet or AdomdDataReader objects.
|Retrieve data in a fast, efficient way||AdomdDataReader|
The AdomdDataReader can be created with a call to the Execute or ExecuteReader method of an AdomdCommand object. This object implements the IDbDataReader interface from the System.Data namespace of the .NET Framework class library.
|Retrieve analytical data with the highest amount of metadata||CellSet|
The CellSet can be created with a call to the Execute or ExecuteCellSet method of an AdomdCommand. Once an AdomdCommand has returned a CellSet, you can then examine the analytical data contained by the CellSet.
|Retrieve metadata about cubes, such as available dimensions, measures, named sets, and so on||CubeDef|
The CubeDef represents metadata about a cube. You reference the CubeDef from the AdomdConnection.
|Retrieve data using the System.Data.IDbDataAdapter interface||AdomdDataAdapter|
The AdomdDataAdapter provides read-only support for existing .NET Framework client applications.