Пример #1
0
 public void Dispose()
 {
     if (server != null)
     {
         server.Dispose();
     }
 }
Пример #2
0
        private static XmlaResultCollection DynamicXMLAParser(
            string serverAddress, string database, string XMLAQuery, bool outputToCsv)
        {
            string ConnectionString = @"Provider=MSOLAP;Data Source=" + serverAddress +
                                      @";Initial Catalog=" + database + ";Integrated Security=SSPI;ImpersonationLevel = Impersonate; persist security info = True; ";

            var XMLA      = XMLAQuery;
            var objServer = new Microsoft.AnalysisServices.Tabular.Server();

            objServer.Connect(ConnectionString);
            var reader = objServer.ExecuteReader(XMLA, out XmlaResultCollection
                                                 resultsOut, null, true);

            // Add all roles to Cached List
            //while (reader.Read())
            //{

            //}
            reader.Close();
            reader.Dispose();
            objServer.Dispose();
            return(resultsOut);
        }