예제 #1
0
 public int ExecuteNonQuery()
 {
     if (_obj != null)
     {
         _obj.Parameters.Clear();
         foreach (AdomdParameter param in _parameters)
         {
             _obj.Parameters.Add(new Microsoft.AnalysisServices.AdomdClient.AdomdParameter(param.Name, param.Value));
         }
         return(_obj.ExecuteNonQuery());
     }
     else
     {
         ExcelAdoMdConnections.ReturnDelegate <int> f = delegate
         {
             _objExcel.Parameters.Clear();
             foreach (AdomdParameter param in _parameters)
             {
                 _objExcel.Parameters.Add(new ExcelAdomdClientReference::Microsoft.AnalysisServices.AdomdClient.AdomdParameter(param.Name, param.Value));
             }
             return(_objExcel.ExecuteNonQuery());
         };
         return(f());
     }
 }
예제 #2
0
 public MemberCollection GetMembers(long start, long count, string[] properties, params MemberFilter[] filters)
 {
     if (_obj != null)
     {
         MemberCollection coll = new MemberCollection();
         foreach (AsAdomdClient.Member member in _obj.GetMembers(start, count, properties, new AsAdomdClient.MemberFilter[] { }))
         {
             coll.Add(new Member(member));
         }
         return(coll);
     }
     else
     {
         ExcelAdoMdConnections.ReturnDelegate <MemberCollection> f = delegate
         {
             MemberCollection coll = new MemberCollection();
             foreach (ExcelAdomdClient.Member member in _objExcel.GetMembers(start, count, properties, new ExcelAdomdClient.MemberFilter[] { }))
             {
                 coll.Add(new Member(member));
             }
             return(coll);
         };
         return(f());
     }
 }
 public DataSet GetSchemaDataSet(string schemaName, AdomdRestrictionCollection restrictions)
 {
     if (_type == AdomdType.AnalysisServices)
     {
         AsAdomdClient.AdomdRestrictionCollection coll = new AsAdomdClient.AdomdRestrictionCollection();
         foreach (AdomdRestriction res in restrictions)
         {
             coll.Add(new AsAdomdClient.AdomdRestriction(res.Name, res.Value));
         }
         return(_conn.GetSchemaDataSet(schemaName, coll));
     }
     else
     {
         ExcelAdoMdConnections.ReturnDelegate <DataSet> f = delegate
         {
             ExcelAdomdClient.AdomdRestrictionCollection coll = new ExcelAdomdClient.AdomdRestrictionCollection();
             foreach (AdomdRestriction res in restrictions)
             {
                 coll.Add(new ExcelAdomdClient.AdomdRestriction(res.Name, res.Value));
             }
             return(_connExcel.GetSchemaDataSet(schemaName, coll));
         };
         return(f());
     }
 }
예제 #4
0
 public AdomdDataReader ExecuteReader()
 {
     if (_obj != null)
     {
         _obj.Parameters.Clear();
         foreach (AdomdParameter param in _parameters)
         {
             _obj.Parameters.Add(new AsAdomdClient.AdomdParameter(param.Name, param.Value));
         }
         return(new AdomdDataReader(_obj.ExecuteReader()));
     }
     else
     {
         ExcelAdoMdConnections.ReturnDelegate <AdomdDataReader> f = delegate
         {
             _objExcel.Parameters.Clear();
             foreach (AdomdParameter param in _parameters)
             {
                 _objExcel.Parameters.Add(new ExcelAdomdClient.AdomdParameter(param.Name, param.Value));
             }
             return(new AdomdDataReader(_objExcel.ExecuteReader()));
         };
         return(f());
     }
 }
 public string GetName(int ordinal)
 {
     if (_type == AdomdType.AnalysisServices)
     {
         return(_reader.GetName(ordinal));
     }
     else
     {
         ExcelAdoMdConnections.ReturnDelegate <string> f = delegate
         {
             return(_readerExcel.GetName(ordinal));
         };
         return(f());
     }
 }
예제 #6
0
 public Guid GetGuid(int i)
 {
     if (_type == AdomdType.AnalysisServices)
     {
         return(_obj.GetGuid(i));
     }
     else
     {
         ExcelAdoMdConnections.ReturnDelegate <Guid> f = delegate
         {
             return(_objExcel.GetGuid(i));
         };
         return(f());
     }
 }
예제 #7
0
 public decimal GetDecimal(int i)
 {
     if (_type == AdomdType.AnalysisServices)
     {
         return(_obj.GetDecimal(i));
     }
     else
     {
         ExcelAdoMdConnections.ReturnDelegate <decimal> f = delegate
         {
             return(_objExcel.GetDecimal(i));
         };
         return(f());
     }
 }
예제 #8
0
 public int GetValues(object[] values)
 {
     if (_type == AdomdType.AnalysisServices)
     {
         return(_obj.GetValues(values));
     }
     else
     {
         ExcelAdoMdConnections.ReturnDelegate <int> f = delegate
         {
             return(_objExcel.GetValues(values));
         };
         return(f());
     }
 }
예제 #9
0
 public string GetString(int i)
 {
     if (_type == AdomdType.AnalysisServices)
     {
         return(_obj.GetString(i));
     }
     else
     {
         ExcelAdoMdConnections.ReturnDelegate <string> f = delegate
         {
             return(_objExcel.GetString(i));
         };
         return(f());
     }
 }
예제 #10
0
 public object GetValue(int i)
 {
     if (_type == AdomdType.AnalysisServices)
     {
         return(_obj.GetValue(i));
     }
     else
     {
         ExcelAdoMdConnections.ReturnDelegate <object> f = delegate
         {
             return(_objExcel.GetValue(i));
         };
         return(f());
     }
 }
 public bool Read()
 {
     if (_type == AdomdType.AnalysisServices)
     {
         return(_reader.Read());
     }
     else
     {
         ExcelAdoMdConnections.ReturnDelegate <bool> f = delegate
         {
             return(_readerExcel.Read());
         };
         return(f());
     }
 }
예제 #12
0
 public int GetOrdinal(string name)
 {
     if (_type == AdomdType.AnalysisServices)
     {
         return(_obj.GetOrdinal(name));
     }
     else
     {
         ExcelAdoMdConnections.ReturnDelegate <int> f = delegate
         {
             return(_objExcel.GetOrdinal(name));
         };
         return(f());
     }
 }
예제 #13
0
 public short GetInt16(int i)
 {
     if (_type == AdomdType.AnalysisServices)
     {
         return(_obj.GetInt16(i));
     }
     else
     {
         ExcelAdoMdConnections.ReturnDelegate <short> f = delegate
         {
             return(_objExcel.GetInt16(i));
         };
         return(f());
     }
 }
예제 #14
0
 public DateTime GetDateTime(int i)
 {
     if (_type == AdomdType.AnalysisServices)
     {
         return(_obj.GetDateTime(i));
     }
     else
     {
         ExcelAdoMdConnections.ReturnDelegate <DateTime> f = delegate
         {
             return(_objExcel.GetDateTime(i));
         };
         return(f());
     }
 }
예제 #15
0
 public DataTable GetSchemaTable()
 {
     if (_type == AdomdType.AnalysisServices)
     {
         return(_obj.GetSchemaTable());
     }
     else
     {
         ExcelAdoMdConnections.ReturnDelegate <DataTable> f = delegate
         {
             return(_objExcel.GetSchemaTable());
         };
         return(f());
     }
 }
예제 #16
0
 public IDataReader GetData(int i)
 {
     if (_type == AdomdType.AnalysisServices)
     {
         return(_obj.GetData(i));
     }
     else
     {
         ExcelAdoMdConnections.ReturnDelegate <IDataReader> f = delegate
         {
             return(_objExcel.GetData(i));
         };
         return(f());
     }
 }
예제 #17
0
 public long GetChars(int i, long fieldoffset, char[] buffer, int bufferoffset, int length)
 {
     if (_type == AdomdType.AnalysisServices)
     {
         return(_obj.GetChars(i, fieldoffset, buffer, bufferoffset, length));
     }
     else
     {
         ExcelAdoMdConnections.ReturnDelegate <long> f = delegate
         {
             return(_objExcel.GetChars(i, fieldoffset, buffer, bufferoffset, length));
         };
         return(f());
     }
 }
예제 #18
0
 public bool IsDBNull(int i)
 {
     if (_type == AdomdType.AnalysisServices)
     {
         return(_obj.IsDBNull(i));
     }
     else
     {
         ExcelAdoMdConnections.ReturnDelegate <bool> f = delegate
         {
             return(_objExcel.IsDBNull(i));
         };
         return(f());
     }
 }
예제 #19
0
 public bool NextResult()
 {
     if (_type == AdomdType.AnalysisServices)
     {
         return(_obj.NextResult());
     }
     else
     {
         ExcelAdoMdConnections.ReturnDelegate <bool> f = delegate
         {
             return(_objExcel.NextResult());
         };
         return(f());
     }
 }
예제 #20
0
 public CubeDef Find(string index)
 {
     if (_obj != null)
     {
         Microsoft.AnalysisServices.AdomdClient.CubeDef obj = _obj.Find(index);
         return(obj == null ? null : new CubeDef(obj));
     }
     else
     {
         ExcelAdoMdConnections.ReturnDelegate <CubeDef> f = delegate
         {
             ExcelAdomdClientReference::Microsoft.AnalysisServices.AdomdClient.CubeDef obj = _objExcel.Find(index);
             return(obj == null ? null : new CubeDef(obj));
         };
         return(f());
     }
 }
예제 #21
0
 public CubeDef Find(string index)
 {
     if (_obj != null)
     {
         AsAdomdClient.CubeDef obj = _obj.Find(index);
         return(obj == null ? null : new CubeDef(obj));
     }
     else
     {
         ExcelAdoMdConnections.ReturnDelegate <CubeDef> f = delegate
         {
             ExcelAdomdClient.CubeDef obj = _objExcel.Find(index);
             return(obj == null ? null : new CubeDef(obj));
         };
         return(f());
     }
 }
예제 #22
0
 public DataSet GetSchemaDataSet(string schemaName, AdomdRestrictionCollection restrictions, bool throwOnInlineErrors)
 {
     if (_type == AdomdType.AnalysisServices)
     {
         global::Microsoft.AnalysisServices.AdomdClient.AdomdRestrictionCollection coll = new global::Microsoft.AnalysisServices.AdomdClient.AdomdRestrictionCollection();
         if (restrictions != null)
         {
             foreach (AdomdClientWrappers.AdomdRestriction res in restrictions)
             {
                 coll.Add(new global::Microsoft.AnalysisServices.AdomdClient.AdomdRestriction(res.Name, res.Value));
             }
         }
         if (_conn.State != ConnectionState.Open)
         {
             _conn.Open();
         }
         lock (rowsetLock)
         {
             return(_conn.GetSchemaDataSet(schemaName, coll, throwOnInlineErrors));
         }
     }
     else
     {
         ExcelAdoMdConnections.ReturnDelegate <DataSet> f = delegate
         {
             ExcelAdomdClientReference::Microsoft.AnalysisServices.AdomdClient.AdomdRestrictionCollection coll = new ExcelAdomdClientReference::Microsoft.AnalysisServices.AdomdClient.AdomdRestrictionCollection();
             if (restrictions != null)
             {
                 foreach (AdomdRestriction res in restrictions)
                 {
                     coll.Add(new ExcelAdomdClientReference::Microsoft.AnalysisServices.AdomdClient.AdomdRestriction(res.Name, res.Value));
                 }
             }
             if (_connExcel.State != ConnectionState.Open)
             {
                 _connExcel.Open();
             }
             lock (rowsetLock)
             {
                 return(_connExcel.GetSchemaDataSet(schemaName, coll, throwOnInlineErrors));
             }
         };
         return(f());
     }
 }
 public object this[string index]
 {
     get
     {
         if (_type == AdomdType.AnalysisServices)
         {
             return(_reader[index]);
         }
         else
         {
             ExcelAdoMdConnections.ReturnDelegate <object> f = delegate
             {
                 return(_readerExcel[index]);
             };
             return(f());
         }
     }
 }
예제 #24
0
 public object this[int i]
 {
     get
     {
         if (_type == AdomdType.AnalysisServices)
         {
             return(_obj[i]);
         }
         else
         {
             ExcelAdoMdConnections.ReturnDelegate <object> f = delegate
             {
                 return(_objExcel[i]);
             };
             return(f());
         }
     }
 }
예제 #25
0
        public string GetDataReaderValue(int i)
        {
            if (_type == AdomdType.AnalysisServices)
            {
                //Microsoft.AnalysisServices.AdomdClient.AdomdDataReader rdr = (Microsoft.AnalysisServices.AdomdClient.AdomdDataReader)_obj.GetValue(i);
                //StringBuilder result = new StringBuilder();
                //while (rdr.Read()) {
                //    result.Append(rdr.GetString(0));
                //}
                //rdr.Close();
                //return result.ToString();

                return(_obj.GetValue(i).ToString());
            }
            else
            {
                ExcelAdoMdConnections.ReturnDelegate <string> f = delegate
                {
                    return(_objExcel.GetValue(i).ToString());
                };
                return(f());
            }
        }