Databases Reference
In-Depth Information
1
Input request from consumer
Access to collection
Input/Output to/from consumer
Microsoft.AnalysisServices.AdomdClient
8
7
Fill
AdomdDataAdapter
System.Data.DataSet
6
AdomdDataReader
Select Command
3
5
'
8
AdomdConnection
Xml File
4
Analysis
Services
FIGURE 33.15
The diagram shows the schema for loading data into the DataSet object.
System.Data.DbDataAdapter
System.Data.IDbDataAdapter
AdomdClient.AdomdData.Adapter
FIGURE 33.16 The ADOMDDataAdapter object inherits from the DbDataAdapter object
and implements the IDbDataAdapter interface.
LISTING 33.24
Populating a Dataset with the Results of a Query Sent to Analysis Services
string commandText = “SELECT Measures.Members ON COLUMNS FROM [Warehouse and Sales]”;
string connectionString = “Datasource=localhost; Initial Catalog=Foodmart 2008;”;
AdomdDataAdapter dataAdapter = new AdomdDataAdapter(commandText, connectionString);
DataSet ds = new DataSet();
dataAdapter.Fill(ds);
As you can see, this piece of code is very simple. Practically all the work of loading the
data occurs during the execution of the Fill method, which opens a connection, sends a
request to the server, and closes the connection. If you need to create more than one
 
Search WWH ::




Custom Search