Databases Reference
In-Depth Information
class Program
{
static void Main (string[] args)
{
string connectionString = "Provider =
MSOLAP.3;Data
Source=localhost;Initial Catalog=Adventure Works DW";
AdomdConnection acCon = new
AdomdConnection (connectionString);
try
{
acCon.Open ();
CubeDef cubeObject =
acCon.Cubes["Adventure Works"];
foreach
(Microsoft.AnalysisServices.AdomdClient.Kpi cubeApi in
cubeObject.Kpis)
{
string commandText = @"SELECT {
strtomember (@Value),
strtomember (@Goal), strtomember (@Status),
strtomember (@Trend) }
ON COLUMNS FROM [" + cubeObject.Name + "]";
AdomdCommand command = new
AdomdCommand (commandText, acCon);
foreach
(Microsoft.AnalysisServices.AdomdClient.Kpi kpi in
cubeObject.Kpis)
{
command.Parameters.Clear ();
command.Parameters.Add (new
AdomdParameter ("Value",
kpi.Properties["KPI_VALUE"].Value));
command.Parameters.Add (new
AdomdParameter ("Goal",
kpi.Properties["KPI_GOAL"].Value));
command.Parameters.Add (new
AdomdParameter ("Status",
kpi.Properties["KPI_STATUS"].Value));
Search WWH ::




Custom Search