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 8877717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T19:32:03+00:00 2026-06-14T19:32:03+00:00

Using EntityFramework, I have created an Entity Model including (SELECT) stored procedures. I have

  • 0

Using EntityFramework, I have created an Entity Model including (SELECT) stored procedures. I have added Function Imports to get the SPs to map to complex types. This works for a query that returns multiple records.

However, for a query that only returns one record, I am currently getting this error:

Cannot convert type 'System.Data.Objects.ObjectResult<DAL.FullResponse>' to 'DAL.FullResponse'  

I don’t know the multiplicity is the problem, but apart from the fact that the problem query takes a row identifier as a parameter, there is nothing about it that enforces a single row result (in fact when I ran the import function wizard it said I would be returning a collection of complex types.

I also don’t know if this is related but I have switched between versions of the EntityFramework while working on this project. After trying to use EF5 caused problems, I switched to EF4 with (until now) no problems.

Relevant code:
aspx

<asp:DetailsView ID="DetailsView1" DataKeyNames="ResponseID" runat="server" 
     AutoGenerateRows="True" Height="250px" Width="350px" BorderWidth="1px" 
     BorderStyle="Dashed" BorderColor="YellowGreen" CellPadding="0" CellSpacing="7" 
     GridLines="None" />

cs

protected void ShowData()
{    
  int respID = Convert.ToInt32(Request.QueryString.Get(0));
  System.Diagnostics.Debug.Print("looking for ID: {0}", respID);

  var responseDetailed = context.GetFullResponse(respID);
  // get the data
  DetailsView1.DataSource = (FullResponse)responseDetailed;
}

ShowData is called from Page_Load

Can someone point me to a way of fixing this? I’ve been stuck on it for nearly a day.

  • 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-06-14T19:32:04+00:00Added an answer on June 14, 2026 at 7:32 pm

    Try this:

    var responseDetailed = context.GetFullResponse(respID);
      // get the data
      DetailsView1.DataSource = (IEnumerable<FullResponse>)responseDetailed;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a very simple Entity Framework 4.0 model using VS2010 Professional. Ignore
I've created my stored procedure, I've created the complex type using the entity model.
I have a edmx file created using the entity entity framework model. Whenever I
Using Microsoft's designer for the Entity Framework (v3.5), I have created an Entity Model
I have created a new application using Entity Framework 4.3 database migrations. The migrations
I am using EntityFramework 4.1. I have the following model: public class User {
Let me explain my problem: I have four tables created as objects using Entity
i have 3 tables in my database and i created a entity model from
Using Entity Framework 4, MVC3, C# I have created a complex type within the
I am using a code-first methodology. I have created my own user model and

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.