Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 809111
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T00:40:26+00:00 2026-05-15T00:40:26+00:00

I’m developing an application that reads data from a SQL server database (migrated from

  • 0

I’m developing an application that reads data from a SQL server database (migrated from a legacy DB) with nHibernate and s#arp architecture through ADO.NET Data services. I’m trying to map a many-to-many relationship. I have a Error class:

public class Error
{
    public virtual int ERROR_ID { get; set; }
    public virtual string ERROR_CODE { get; set; }
    public virtual string DESCRIPTION { get; set; }

    public virtual IList<ErrorGroup> GROUPS { get; protected set; }
}

And then I have the error group class:

public class ErrorGroup
{
    public virtual int ERROR_GROUP_ID {get; set;}
    public virtual string ERROR_GROUP_NAME { get; set; }
    public virtual string DESCRIPTION { get; set; }

    public virtual IList<Error> ERRORS { get; protected set; }
}

And the overrides:

public class ErrorGroupOverride : IAutoMappingOverride<ErrorGroup>
{
    public void Override(AutoMapping<ErrorGroup> mapping)
    {
        mapping.Table("ERROR_GROUP");
        mapping.Id(x => x.ERROR_GROUP_ID, "ERROR_GROUP_ID");
        mapping.IgnoreProperty(x => x.Id);
        mapping.HasManyToMany<Error>(x => x.Error)
            .Table("ERROR_GROUP_LINK")
            .ParentKeyColumn("ERROR_GROUP_ID")
            .ChildKeyColumn("ERROR_ID").Inverse().AsBag();
    }
}

public class ErrorOverride : IAutoMappingOverride<Error>
{
    public void Override(AutoMapping<Error> mapping)
    {
        mapping.Table("ERROR");
        mapping.Id(x => x.ERROR_ID, "ERROR_ID");
        mapping.IgnoreProperty(x => x.Id);
        mapping.HasManyToMany<ErrorGroup>(x => x.GROUPS)
            .Table("ERROR_GROUP_LINK")
            .ParentKeyColumn("ERROR_ID")
            .ChildKeyColumn("ERROR_GROUP_ID").AsBag();
    }
}

When I view the Data service in the browser like: http://localhost:1905/DataService.svc/Errors it shows the list of errors with no problems, and using it like http://localhost:1905/DataService.svc/Errors(123) works too.

The Problem
When I want to see the Errors in a group or the groups form an error, like: “http://localhost:1905/DataService.svc/Errors(123)?$expand=GROUPS” I get the XML Document, but the browser says:

The XML page cannot be displayed 
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later. 
--------------------------------------------------------------------------------
Only one top level element is allowed in an XML document. Error processing resource 'http://localhost:1905/DataServic...
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
-^

I view the sourcecode, and I get the data. However it comes with an exception:

<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
  <code></code>
  <message xml:lang="en-US">An error occurred while processing this request.</message>
  <innererror xmlns="xmlns">
    <message>A single resource was expected for the result, but multiple resources were found.</message>

    <type>System.InvalidOperationException</type>
    <stacktrace>   at System.Data.Services.Serializers.Serializer.WriteRequest(IEnumerator queryResults, Boolean hasMoved)&#xD;
   at System.Data.Services.ResponseBodyWriter.Write(Stream stream)</stacktrace>
  </innererror>
</error>

A I missing something??? Where does this error come from?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T00:40:27+00:00Added an answer on May 15, 2026 at 12:40 am

    I think this was due to an error with linq and nHibernate, worked after I restricted the results to return just one.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a view passing on information from a database: def serve_article(request, id): served_article
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I am doing a simple coin flipping experiment for class that involves flipping a
I have a text area in my form which accepts all possible characters from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.