private void TranslateException(XmlaError innerError)
        {
            AdomdError error = new AdomdError(innerError);

            if (this.errors == null)
            {
                this.errors = new AdomdErrorCollection();
            }
            this.errors.Add(error);
        }
コード例 #2
0
 internal AdomdError(XmlaError error) : this(error.ErrorCode, error.Source, error.Description, error.HelpFile, error.Location, error.CallStack)
 {
 }
コード例 #3
0
 internal XmlaResult(XmlaError error)
 {
     this.Messages.Add(error);
 }
コード例 #4
0
        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);
        }
 internal AdomdErrorResponseException(XmlaError innerError)
 {
     this.TranslateException(innerError);
 }