Mef*_*eff 12
要进行处理,请使用Microsoft.AnalysisServices库,示例代码如下所示:
Server server = new Server();
server.Connect(cubeConnectionString);
Database database = server.Databases.FindByName(databaseName);
Cube cube = database.Cubes.FindByName(cubeName);
cube.Process(ProcessType.ProcessFull);
Run Code Online (Sandbox Code Playgroud)
对于查询,请使用Microsoft.AnalysisServices.AdomdClient库,示例代码如下所示:
using (Adomd.AdomdConnection adomdConnection = new Microsoft.AnalysisServices.AdomdClient.AdomdConnection())
{
adomdConnection.ConnectionString = cubeConnectionString;
Adomd.AdomdCommand adomdCommand = new Microsoft.AnalysisServices.AdomdClient.AdomdCommand();
adomdCommand.Connection = adomdConnection;
adomdCommand.CommandText = mdxQuery;
adomdConnection.Open();
cellSet = adomdCommand.ExecuteCellSet();
adomdConnection.Close();
}
Run Code Online (Sandbox Code Playgroud)
请注意,两个名称空间重叠,因此如果在同一位置使用它们,则可能需要别名.
http://msdn.microsoft.com/en-US/library/ms124924(v=SQL.90).aspx
http://msdn.microsoft.com/en-us/library/ms123483(v=SQL.90).aspx