internal void PopulateIgnorableNamespaces(XmlReader reader) { if (!reader.IsStartElement("NamespaceCompatibility", "http://schemas.microsoft.com/analysisservices/2003/engine")) { this.namespacesToIgnore = null; return; } this.namespacesToIgnore = new Hashtable(); DataSet dataSet = NamespacesMgr.compatibilityDataSet.Clone(); reader.ReadStartElement("NamespaceCompatibility", "http://schemas.microsoft.com/analysisservices/2003/engine"); if (!reader.IsStartElement("root", "urn:schemas-microsoft-com:xml-analysis:rowset")) { throw new AdomdUnknownResponseException(XmlaSR.UnknownServerResponseFormat, string.Format(CultureInfo.InvariantCulture, "Expected {0}:{1} element, got {2}", new object[] { "urn:schemas-microsoft-com:xml-analysis:rowset", "root", reader.Name })); } if (reader.IsEmptyElement) { reader.ReadStartElement(); } else { reader.ReadStartElement("root", "urn:schemas-microsoft-com:xml-analysis:rowset"); RowsetFormatter.PopulateDataset(reader, "row", "urn:schemas-microsoft-com:xml-analysis:rowset", InlineErrorHandlingType.StoreInCell, dataSet.Tables["rowsetTable"]); DataTable dataTable = dataSet.Tables["rowsetTable"]; foreach (DataRow dataRow in dataTable.Rows) { string text = dataRow["Namespace"] as string; if (text != null) { DataRow[] childRows = dataRow.GetChildRows("rowsetTableCompatibility"); if (childRows.Length > 0) { DataRow[] array = childRows; for (int i = 0; i < array.Length; i++) { DataRow dataRow2 = array[i]; string a = dataRow2["ProductBranch"] as string; object obj = dataRow2["VersionTimeStamp"]; DateTime t = (obj == null || obj is DBNull) ? DateTime.MinValue : ((DateTime)obj); if ((a == "MicrosoftAnalysisServices" || a == "xmla") && t <= NamespacesMgr.AdomdVersionTimeStamp && !this.IsKnown(text)) { this.namespacesToIgnore[text] = 1; } } } else if (!this.IsKnown(text)) { this.namespacesToIgnore[text] = 1; } } } reader.ReadEndElement(); } reader.ReadEndElement(); }
public void ReadRowset(XmlReader reader, InlineErrorHandlingType inlineErrorHandling, DataTable inTable, bool doCreate, bool schemaOnly, Dictionary <string, bool> columnsToConvertTimeFor) { if (doCreate) { this.CreateDataset(reader, inlineErrorHandling == InlineErrorHandlingType.Throw || inlineErrorHandling == InlineErrorHandlingType.StoreInErrorsCollection, inTable, columnsToConvertTimeFor); } if (!schemaOnly) { RowsetFormatter.PopulateDataset(reader, inlineErrorHandling, (inTable == null) ? this.rowsetDataset.Tables["rowsetTable"] : inTable); } }