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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:01:36+00:00 2026-05-27T19:01:36+00:00

For one of our recent projects, we created a stored procedure which generated SQL

  • 0

For one of our recent projects, we created a stored procedure which generated SQL and executed it in the end. The purpose of the stored procedure was to create pivots based on dynamic columns.

When trying to access it using Entity Framework using the usual function import when I tried to access the stored procedure, it would return anything as it requires a dynamic type to store the retrieved data.

Which in our case was a dynamic query and linq was unable to get the returned columns. So to work around what I did was call the stored procedure in the traditional way i.e. creating a DataAdapter and SqlCommand object and SqlConnection object.

But what is the proper way of calling this kind of stored procedure using Entity Framework?

Thanks in advance.

  • 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-27T19:01:37+00:00Added an answer on May 27, 2026 at 7:01 pm

    Entity framework doesn’t support dynamic result sets from stored procedures. It also doesn’t support stored procedures using dynamic SQL because it cannot get static result set declaration from the procedure. So you must either ensure that your procedure will always return static type (same number of columns with same names) or you must use traditional ADO.NET to execute that procedure.

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

Sidebar

Related Questions

One of our programs is erroring out because a stored procedure was created with
In a widely used include file in one of our projects we have these
As part of one our system's we enable a user in the backoffice to
I just spent half an one our to find out what caused the Error-Message
One of our weblogic 8.1s has suddenly started logging giant amounts of logs and
One of our developers is continually writing code and putting it into version control
One of our unit tests is to populate properties within our business objects with
One of our internally written tool is fed a cvs commit trace of the
One of our programs is sometimes getting an OutOfMemory error on one user's machine,
One of our providers are sometimes sending XML feeds that are tagged as UTF-8

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.