예제 #1
0
        private DataRow[] GetRows(DataRow parentRow, string filter)
        {
            string text;

            if (parentRow != null)
            {
                text = AdomdUtils.GetDataTableFilter(this.relationColumn, parentRow[this.relationColumn].ToString());
                if (filter != null)
                {
                    text = string.Concat(new string[]
                    {
                        "(",
                        text,
                        " and ",
                        filter,
                        ")"
                    });
                }
            }
            else
            {
                text = filter;
            }
            return(this.cacheTable.Select(text));
        }
        public Member Find(string index)
        {
            if (index == null)
            {
                throw new ArgumentNullException("index");
            }
            if (!this.memberHierarchyDataTable.Columns.Contains("MEMBER_NAME"))
            {
                throw new NotSupportedException();
            }
            string dataTableFilter = AdomdUtils.GetDataTableFilter("MEMBER_NAME", index);

            DataRow[] array = this.memberHierarchyDataTable.Select(dataTableFilter);
            Member    result;

            if (array.Length > 0)
            {
                result = new Member(this.connection, array[0], this.parentLevel, this.parentMember, MemberOrigin.InternalMemberQuery, this.cubeName, null, -1, this.catalog, this.sessionId);
            }
            else
            {
                result = null;
            }
            return(result);
        }
        internal DataRow FindObjectByName(string name, DataRow parentRow, string nameColumn)
        {
            this.PopulateCollection();
            string dataTableFilter = AdomdUtils.GetDataTableFilter(nameColumn, name);

            DataRow[] filteredRows = this.objectCache.GetFilteredRows(parentRow, dataTableFilter);
            if (filteredRows.Length <= 0)
            {
                return(null);
            }
            return(filteredRows[0]);
        }
예제 #4
0
        DataRow IMetadataCache.FindObjectByUniqueName(SchemaObjectType objectType, string nameUnique)
        {
            this.Populate((InternalObjectType)objectType);
            ObjectMetadataCache objectCache = this.GetObjectCache((InternalObjectType)objectType);
            string dataTableFilter          = AdomdUtils.GetDataTableFilter(this.GetUniqueNameColumn((InternalObjectType)objectType), nameUnique);

            DataRow[] filteredRows = ((IObjectCache)objectCache).GetFilteredRows(null, dataTableFilter);
            if (filteredRows.Length <= 0)
            {
                return(null);
            }
            return(filteredRows[0]);
        }