internal void PopulateSelf() { if (this.connection == null) { throw new NotSupportedException(SR.NotSupportedWhenConnectionMissing); } AdomdUtils.CheckConnectionOpened(this.connection); if (!this.IsInitialized) { this.cacheTable = new DataTable(); this.cacheTable.Locale = CultureInfo.InvariantCulture; this.cacheTable.Columns.Add("ObjectColumn_ADOMDInternal$$", typeof(object)); } if (this.isNestedSchema) { ObjectMetadataCache.DiscoverNested(this.connection, this.requestType, this.restrictions, out this.cacheDataSet); this.cacheTable.Columns.Add("__RowIndex__", typeof(int)); object[] array = new object[2]; for (int i = 0; i < this.cacheDataSet.Tables[0].Rows.Count; i++) { array[0] = null; array[1] = i; this.cacheTable.Rows.Add(array); } } else { ObjectMetadataCache.Discover(this.connection, this.requestType, this.restrictions, this.cacheTable, !this.isInitialized); } this.cacheState = MetadataCacheState.UpToDate; this.isInitialized = true; }
internal void PopulateParentLevel() { if (this.Connection == null) { throw new NotSupportedException(SR.NotSupportedWhenConnectionMissing); } AdomdUtils.CheckConnectionOpened(this.Connection); string parentLevelUName = this.ParentLevelUName; this.parentLevel = (this.Connection.GetObjectData(SchemaObjectType.ObjectTypeLevel, this.baseData.CubeName, parentLevelUName) as Level); }
private void CheckCanExecute() { if (this.connection == null) { throw new InvalidOperationException(SR.Command_ConnectionIsNotSet); } AdomdUtils.CheckConnectionOpened(this.connection); if (this.CommandText == null && this.CommandStream == null) { throw new InvalidOperationException(SR.Command_CommandTextCommandStreamNotSet); } if (this.CommandStream != null && this.CommandText != null) { throw new InvalidOperationException(SR.Command_CommandTextCommandStreamBothSet); } }
internal static void PopulateSymetry(IAdomdBaseObject iBaseObject) { if (iBaseObject.Connection == null) { throw new NotSupportedException(SR.NotSupportedWhenConnectionMissing); } AdomdUtils.CheckConnectionOpened(iBaseObject.Connection); if (iBaseObject.CubeName == null) { throw new NotSupportedException(SR.NotSupportedByProvider); } IAdomdBaseObject adomdBaseObject = (IAdomdBaseObject)iBaseObject.Connection.GetObjectData(iBaseObject.SchemaObjectType, iBaseObject.CubeName, iBaseObject.InternalUniqueName); iBaseObject.MetadataData = adomdBaseObject.MetadataData; iBaseObject.ParentObject = adomdBaseObject.ParentObject; iBaseObject.IsMetadata = true; }
private MemberCollection ExecuteMembersQuery(string memberMdxQuery, Level parentLevel, Member parentMember, int memberAxisPosition, int memberHierarhcyPosition) { if (memberAxisPosition < 0) { throw new ArgumentOutOfRangeException("memberAxisPosition"); } if (memberHierarhcyPosition < 0) { throw new ArgumentOutOfRangeException("memberHierarhcyPosition"); } AdomdConnection connection = this.Connection; if (connection == null) { throw new NotSupportedException(SR.NotSupportedWhenConnectionMissing); } AdomdUtils.CheckConnectionOpened(connection); AdomdCommand adomdCommand = new AdomdCommand(memberMdxQuery, connection); CellSet cellSet = adomdCommand.ExecuteCellSet(); if (memberAxisPosition >= cellSet.Axes.Count) { throw new ArgumentOutOfRangeException("memberAxisPosition"); } Axis axis = cellSet.Axes[memberAxisPosition]; IDSFDataSet axisDataset = axis.Set.AxisDataset; DataTable memberHierarchyDataTable = null; if (memberHierarhcyPosition != 0 || axisDataset.Count != 0) { if (memberHierarhcyPosition >= axisDataset.Count) { throw new ArgumentOutOfRangeException("memberHierarhcyPosition"); } memberHierarchyDataTable = axisDataset[memberHierarhcyPosition]; } return(new MemberCollection(connection, memberHierarchyDataTable, this.Name, parentLevel, parentMember)); }