예제 #1
0
 public void Execute()
 {
     if (_obj != null)
     {
         _obj.Parameters.Clear();
         foreach (AdomdParameter param in _parameters)
         {
             _obj.Parameters.Add(new Microsoft.AnalysisServices.AdomdClient.AdomdParameter(param.Name, param.Value));
         }
         _obj.Execute();
     }
     else
     {
         ExcelAdoMdConnections.VoidDelegate f = delegate
         {
             _objExcel.Parameters.Clear();
             foreach (AdomdParameter param in _parameters)
             {
                 _objExcel.Parameters.Add(new ExcelAdomdClientReference::Microsoft.AnalysisServices.AdomdClient.AdomdParameter(param.Name, param.Value));
             }
             _objExcel.Execute();
         };
         f();
     }
 }
예제 #2
0
 public void Close()
 {
     if (_type == AdomdType.AnalysisServices)
     {
         _conn.Close();
     }
     else
     {
         ExcelAdoMdConnections.VoidDelegate f = delegate
         {
             _connExcel.Close();
         };
         f();
     }
 }
예제 #3
0
 public void Open(string connectionString)
 {
     if (_type == AdomdType.AnalysisServices)
     {
         _conn.Open(connectionString);
     }
     else
     {
         ExcelAdoMdConnections.VoidDelegate f = delegate
         {
             _connExcel.Open(connectionString);
         };
         f();
     }
 }
예제 #4
0
 public void Dispose()
 {
     if (_type == AdomdType.AnalysisServices)
     {
         _obj.Dispose();
     }
     else
     {
         ExcelAdoMdConnections.VoidDelegate f = delegate
         {
             _objExcel.Dispose();
         };
         f();
     }
 }
예제 #5
0
 public void Fill(DataTable tbl)
 {
     if (_obj != null)
     {
         _obj.Fill(tbl);
     }
     else
     {
         ExcelAdoMdConnections.VoidDelegate f = delegate
         {
             _objExcel.Fill(tbl);
         };
         f();
     }
 }
예제 #6
0
 public void Cancel()
 {
     if (_obj != null)
     {
         _obj.Cancel();
     }
     else
     {
         ExcelAdoMdConnections.VoidDelegate f = delegate
         {
             _objExcel.Cancel();
         };
         f();
     }
 }
예제 #7
0
 public AdomdConnection(string connectionString, AdomdType type)
 {
     _type = type;
     if (_type == AdomdType.AnalysisServices)
     {
         _conn = new Microsoft.AnalysisServices.AdomdClient.AdomdConnection(connectionString);
     }
     else
     {
         ExcelAdoMdConnections.VoidDelegate f = delegate
         {
             _connExcel = new ExcelAdomdClientReference::Microsoft.AnalysisServices.AdomdClient.AdomdConnection(connectionString);
         };
         f();
     }
 }
예제 #8
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();
     }
 }
예제 #9
0
 public void RefreshMetadata()
 {
     if (_type == AdomdType.AnalysisServices)
     {
         if (_conn != null)
         {
             _conn.RefreshMetadata();
         }
     }
     else
     {
         ExcelAdoMdConnections.VoidDelegate f = delegate
         {
             if (_connExcel != null)
             {
                 _connExcel.RefreshMetadata();
             }
         };
         f();
     }
 }
예제 #10
0
 public void Dispose()
 {
     if (_type == AdomdType.AnalysisServices)
     {
         if (_conn != null)
         {
             _conn.Dispose();
             _conn = null;
         }
     }
     else
     {
         ExcelAdoMdConnections.VoidDelegate f = delegate
         {
             if (_connExcel != null)
             {
                 _connExcel.Dispose();
                 _connExcel = null;
             }
         };
         f();
     }
 }
예제 #11
0
 public void ChangeDatabase(string database)
 {
     if (database == null)
     {
         return;
     }
     if (database.Trim().Length == 0)
     {
         return;
     }
     if (_type == AdomdType.AnalysisServices)
     {
         _conn.ChangeDatabase(database);
     }
     else
     {
         ExcelAdoMdConnections.VoidDelegate f = delegate
         {
             _connExcel.ChangeDatabase(database);
         };
         f();
     }
 }