Databases Reference
In-Depth Information
command.Parameters.Add (new
AdomdParameter ("Trend",
kpi.Properties["KPI_TREND"].Value));
CellSet cellset =
command.ExecuteCellSet ();
Console.WriteLine ("KPI
Name:" + kpi.Name);
Console.WriteLine ("Value:" +
cellset.Cells[0].FormattedValue);
Console.WriteLine ("Goal:" +
cellset.Cells[1].FormattedValue);
Console.WriteLine ("Status:"
+
cellset.Cells[2].FormattedValue);
Console.WriteLine ("Trend:" +
cellset.Cells[3].FormattedValue);
}
}
}
finally
{
acCon.Close ();
}
}
}
}
Note that this example uses a parameterized MDX query and the StrToMem-
ber function to avoid MDX injection. The developer of a client-side application
needs to be cautious with user input; a simple string concatenation would al-
low a malicious user to input and run harmful code. You can create a new C#
program called QueryKPI, copy the above code, add the Mi-
crosoft.AnalysisServices.AdomdClient DLL as a reference and run the pro-
gram. We recommend you explore the .NET Adomd client object model by
writing client programs that leverage the object model.
Search WWH ::




Custom Search