1. String serverName = "localhost";
  2. String databaseName = "PM Cube Solution 15 01 2008";
  3. String databaseID = databaseName;
  4. String cubeID = "Beispiel Daten";
  5. AdomdConnection cn = new AdomdConnection("Provider=MSOLAP;Data Source=" + serverName + ";Initial Catalog=" + databaseName);
  6. cn.Open();
  7. AdomdCommand cmd;
  8. cmd = cn.CreateCommand();
  9. cmd.CommandType = CommandType.Text;
  10.  
  11. cmd.CommandText = "<Batch xmlns=\"http://schemas.microsoft.com/analysisservices/2003/engine\"><Parallel><Process> <Object>" +
  12. "<DatabaseID>" + databaseID + "</DatabaseID>" +
  13. "<CubeID>" + cubeID + "</CubeID> " +
  14. "</Object><Type>ProcessFull</Type><WriteBackTableCreation>UseExisting</WriteBackTableCreation> </Process> </Parallel> </Batch>";
  15. try
  16. {
  17. Console.WriteLine("Executing Command...");
  18. cmd.ExecuteNonQuery();
  19. }
  20. catch (Exception ex)
  21. {
  22. Console.WriteLine(ex.Message);
  23. }
  24. finally
  25. {
  26. cn.Close();
  27. Console.WriteLine("Finished");
  28. }






look at this sample:
http://snipplr.com/view/11385/process-ssas-cube/


Accepted Solution250EXCELLENT

2010-05-24 at 05:54:44ID: 32832095

To open up connections to Analysis services, you'll use ADOMD.NET.
Info on opening the connection:
http://technet.microsoft.com/en-us/library/ms123468.aspx

Another example on processing a cube.  Not in C#, but concepts and calls the same.
http://social.msdn.microsoft.com/forums/en-US/sqlanalysisservices/thread/567b6a76-9d45-4bd6-9fb6-ddd28c5c31b3/





'OLAP' 카테고리의 다른 글

[OLAP]Dynamic XMLA using T-SQL for SQL Server Analysis Services  (0) 2016.05.03
[OLAP MDX 스크립트  (0) 2015.07.16
[OLAP] 웹서비스 접속환경 설정  (0) 2012.12.17
OLAP의 12가지 규칙  (0) 2012.03.27
OLAP(On-Line Analytical Processing)  (0) 2012.03.27
Posted by 요지
,