locked
How can I process my cube from a windows form? RRS feed

Answers

  • I found this code in a different thread, but it should work here.  This code reads the xmla from a file. 

     

     

    Code Snippet
    using System.IO;
    using Microsoft.AnalysisServices.AdomdClient;

    public class XmlaExecutor
    {
       public static void Main(string[] args)
       {
          TextReader tr = File.OpenText(args[0]);
          string xmla = tr.ReadToEnd();
          tr.Close();
          AdomdConnection cn = new AdomdConnection("Data Source=localhost");
          cn.Open();
          AdomdCommand cmd = cn.CreateCommand();
          cmd.CommandText = xmla;
          cmd.ExecuteNonQuery();
          cn.Close();
       }
    }

     


    Tuesday, July 10, 2007 10:56 PM
  • You can also use AMO (Microsoft.AnalysisServices.dll), the management object model for Analysis Services 2005. ADOMD.NET (Microsoft.AnalysisServices.AdomdClient.dll) is mostly for querying data, while AMO is for management tasks like process, backup, restore, create, delete objects.

    Quick info on AMO: http://adriandu.spaces.live.com/

    Sample AMO code to create and process a partition: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=516918&SiteID=1

     

    Adrian Dumitrascu

    Wednesday, July 11, 2007 5:15 PM

All replies

  • I found this code in a different thread, but it should work here.  This code reads the xmla from a file. 

     

     

    Code Snippet
    using System.IO;
    using Microsoft.AnalysisServices.AdomdClient;

    public class XmlaExecutor
    {
       public static void Main(string[] args)
       {
          TextReader tr = File.OpenText(args[0]);
          string xmla = tr.ReadToEnd();
          tr.Close();
          AdomdConnection cn = new AdomdConnection("Data Source=localhost");
          cn.Open();
          AdomdCommand cmd = cn.CreateCommand();
          cmd.CommandText = xmla;
          cmd.ExecuteNonQuery();
          cn.Close();
       }
    }

     


    Tuesday, July 10, 2007 10:56 PM
  • Thanks a lot, that worked perfectly.  The only thing I had to do was add the .NET reference to Microsoft.AnalysisServices.AdomdClient.
    Wednesday, July 11, 2007 1:39 PM
  • You can also use AMO (Microsoft.AnalysisServices.dll), the management object model for Analysis Services 2005. ADOMD.NET (Microsoft.AnalysisServices.AdomdClient.dll) is mostly for querying data, while AMO is for management tasks like process, backup, restore, create, delete objects.

    Quick info on AMO: http://adriandu.spaces.live.com/

    Sample AMO code to create and process a partition: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=516918&SiteID=1

     

    Adrian Dumitrascu

    Wednesday, July 11, 2007 5:15 PM