internal static void PopulateDataset(XmlReader reader, string rowElementName, string rowNamespace, InlineErrorHandlingType inlineErrorHandling, DataTable inTable) { DataSet dataSet = inTable.DataSet; if (dataSet != null) { IEnumerator enumerator = dataSet.Tables.GetEnumerator(); { while (enumerator.MoveNext()) { DataTable dataTable = (DataTable)enumerator.Current; dataTable.BeginLoadData(); } goto IL_50; } } inTable.BeginLoadData(); IL_50: RowsetFormatter.PopulateMultiRow(reader, rowElementName, rowNamespace, inTable, inlineErrorHandling, -1); if (dataSet != null) { IEnumerator enumerator2 = dataSet.Tables.GetEnumerator(); { while (enumerator2.MoveNext()) { DataTable dataTable2 = (DataTable)enumerator2.Current; dataTable2.EndLoadData(); } return; } } inTable.EndLoadData(); }
private static void PopulateRow(XmlReader reader, DataTable datatable, InlineErrorHandlingType inlineErrorHandling, int parentRowIndex, DataColumn parentColumn) { DataRow dataRow = RowsetFormatter.CreateNewRow(datatable, parentColumn, parentRowIndex); while (reader.IsStartElement()) { FormattersHelpers.CheckException(reader); if (!FormattersHelpers.IsNullContentElement(reader)) { string localName = reader.LocalName; DataColumn dataColumn = datatable.Columns[localName]; if (dataColumn == null) { throw new AdomdUnknownResponseException(XmlaSR.UnknownServerResponseFormat, string.Format(CultureInfo.InvariantCulture, "Unknown column {0}", new object[] { localName })); } string columnNamespace = FormattersHelpers.GetColumnNamespace(dataColumn); if (reader.NamespaceURI == columnNamespace) { if (RowsetFormatter.IsNestedColumn(dataColumn)) { DataTable dataTable = RowsetFormatter.FindNestedTable(dataColumn); if (dataTable != null) { RowsetFormatter.PopulateMultiRow(reader, localName, columnNamespace, dataTable, inlineErrorHandling, (int)dataRow[dataColumn]); } else { reader.Skip(); } } else { Type elementType = FormattersHelpers.GetElementType(reader, "http://www.w3.org/2001/XMLSchema-instance", dataColumn); bool throwOnInlineError = inlineErrorHandling == InlineErrorHandlingType.Throw; object obj = FormattersHelpers.ReadRowsetProperty(reader, localName, columnNamespace, elementType, throwOnInlineError, elementType.IsArray && FormattersHelpers.GetColumnXsdTypeName(dataColumn) != "base64Binary", FormattersHelpers.GetConvertToLocalTime(dataColumn)); if (inlineErrorHandling == InlineErrorHandlingType.StoreInErrorsCollection) { XmlaError xmlaError = obj as XmlaError; if (xmlaError == null) { dataRow[localName] = obj; } else { dataRow.SetColumnError(localName, xmlaError.Description); } } else { dataRow[localName] = obj; } } } else { reader.Skip(); } } else { reader.Skip(); } } datatable.Rows.Add(dataRow); }
private static void PopulateDataset(XmlReader reader, InlineErrorHandlingType inlineErrorHandling, DataTable inTable) { RowsetFormatter.PopulateMultiRow(reader, FormattersHelpers.RowElement, FormattersHelpers.RowElementNamespace, inTable, inlineErrorHandling, -1); }