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

  • SEARCH
  • Home
  • 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 8343045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T05:56:36+00:00 2026-06-09T05:56:36+00:00

1 (mvc3) I have added a stored proc to my model as mapped to

  • 0

1 (mvc3) I have added a stored proc to my model as mapped to a ComplextType.

Two Issues:

1) ComplextType.cs exists in class under Model1.tt BUT doesn’t show up in .edmx?
2) When I try to create a controller with strongly typed views with that ComplexType.cs it errors stating that it can’t be created because ComplextType.cs is not part of the DbContextEntities class?

How can I get this complex type added to the .edmx and mapped to my dbcontext (I have done this with tables but not sure what I’m missing for the stored procedures?

Thanks!

  • 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-09T05:56:38+00:00Added an answer on June 9, 2026 at 5:56 am

    For those who just came here from googling,, :)I will give the what is basically has to be done to map a stored procedure into a ADO.Net entity.

    When mapping the Database to the EDMX file(Entity Model).. the Entity Model automatically map the tables and complex types and ect.. But the stored procedures that are created in the database is not mapped with return complex types. We have to map it in the Function imports by creating our own complex type. This complex type can be accessed in the code.

    This is done as below:

    1. Right click on the function Import and add new Function import.
    2. Give your name to the function and specify the stored procedure and
      then select complex type(If stored procedure returns complex type)
      or you can select scalar. IF you are selecting the complex type and
      you can view the columns that are returning and you can create a complex there by create new complex type.
    3. So the return data from the stored procedure will be a set of those complex type.

    One thing that should be one should access the design or the model view to update the Entity Model. You can not update the Entity Model by just right clicking on the Entity Model. The option of updating the model is provided only on the Model Browser and the Database design diagram. This model browser can be taken from the Other windows of Views in VS2010/VS2012. These information will seems boring. But trust me if you are new to this these seems big at the beginning.

    Most probably you are going to create this Entity Model from mapping an existing database.

    Keep in mind that even you map the Entity model form the database you can customize the Entity model by deleting the unnecessary entities(tables) and creating complex types

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

Sidebar

Related Questions

I am using MVC3 and added model validation with required attributes. Then I have
While working on ASP.NET MVC3 application, by mistake I have added a Class library
I have added the following to my web.config file in my asp.net mvc3, to
I have a class library that has it's own model and connectionstring to the
I have a couple of MVC3 web applications in my project. I have added
I have created a basic MVC3 site and have added image paths into the
Edit: Added bounty because I'm seeking an MVC3 solution (if one exists) other than
I have a View in my MVC3 application which displays one of two pretty
I have a asp.net MVC3 Application with two users Admin and General.Cookies is saved
We have some files stored in sql database. On an ASP.NET MVC3 form, we

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.