Example #1
0
        public AdomdCommand CreateCommand()
        {
            var cmd = new AdomdCommand
            {
                Connection = this
            };

            return(cmd);
        }
Example #2
0
        public AdomdDataAdapter(AdomdCommand command)
        {
            Contract.Requires(command != null, "The command parameter must not be null");


            _obj = new Microsoft.AnalysisServices.AdomdClient.AdomdDataAdapter
            {
                SelectCommand = (Microsoft.AnalysisServices.AdomdClient.AdomdCommand)command.UnderlyingCommand
            };
        }
Example #3
0
 public AdomdDataAdapter(AdomdCommand obj)
 {
     if (obj.Connection.Type == AdomdType.AnalysisServices)
     {
         _obj = new Microsoft.AnalysisServices.AdomdClient.AdomdDataAdapter();
         _obj.SelectCommand = (Microsoft.AnalysisServices.AdomdClient.AdomdCommand)obj.UnderlyingCommand;
     }
     else
     {
         ExcelAdoMdConnections.VoidDelegate f = delegate
         {
             _objExcel = new ExcelAdomdClientReference::Microsoft.AnalysisServices.AdomdClient.AdomdDataAdapter();
             _objExcel.SelectCommand =
                 (ExcelAdomdClientReference::Microsoft.AnalysisServices.AdomdClient.AdomdCommand)obj.UnderlyingCommand;
         };
         f();
     }
 }
Example #4
0
 public AdomdDataAdapter(AdomdCommand obj)
 {
     if (obj.Connection.Type == AdomdType.AnalysisServices)
     {
         _obj = new Microsoft.AnalysisServices.AdomdClient.AdomdDataAdapter();
         _obj.SelectCommand = (Microsoft.AnalysisServices.AdomdClient.AdomdCommand) obj.UnderlyingCommand;
     }
     else
     {
         ExcelAdoMdConnections.VoidDelegate f = delegate
         {
             _objExcel = new ExcelAdomdClientReference::Microsoft.AnalysisServices.AdomdClient.AdomdDataAdapter();
             _objExcel.SelectCommand =
                 (ExcelAdomdClientReference::Microsoft.AnalysisServices.AdomdClient.AdomdCommand) obj.UnderlyingCommand;
         };
         f();
     }
 }
Example #5
0
        public AdomdCommand CreateCommand()
        {
            //if (_type == AdomdType.AnalysisServices)
            //{
            var cmd = new AdomdCommand();

            cmd.Connection = this;
            return(cmd);

            /*}
             * else
             * {
             *  ExcelAdoMdConnections.ReturnDelegate<ExcelAdomdClientReference.Microsoft.AnalysisServices.AdomdClient.AdomdCommand> f = delegate
             *  {
             *      return _connExcel.CreateCommand();
             *  };
             *  f();
             * }
             */
        }
        public DataTable ExecuteDaxQueryDataTable(string query)
        {
            _runningCommand = _adomdConn.CreateCommand();
            _runningCommand.CommandType = CommandType.Text;
            _runningCommand.CommandText = query;
            var da = new AdomdDataAdapter(_runningCommand);
            var dt = new DataTable("DAXResult");
            if (_adomdConn.State != ConnectionState.Open) _adomdConn.Open();
            da.Fill(dt);

            FixColumnNaming(dt);
            _runningCommand = null;
            return dt;
        }
Example #7
0
 public AdomdCommand CreateCommand()
 {
     //if (_type == AdomdType.AnalysisServices)
     //{
         var cmd = new AdomdCommand();
         cmd.Connection = this;
         return cmd;
     /*}
     else
     {
         ExcelAdoMdConnections.ReturnDelegate<ExcelAdomdClientReference.Microsoft.AnalysisServices.AdomdClient.AdomdCommand> f = delegate
         {
             return _connExcel.CreateCommand();
         };
         f();
     }
      */
 }