Posted By

qrist0ph on 01/21/09


Tagged

ssas


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

umang_nine


Process SSAS Cube


 / Published in: C#
 

  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. }

Report this snippet  

You need to login to post a comment.