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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:39:53+00:00 2026-05-26T10:39:53+00:00

I am currently using Entity Framework in an ASP.NET MVC 3 project. And I

  • 0

I am currently using Entity Framework in an ASP.NET MVC 3 project.
And I am getting severe performance issues while looping through the records in the view to display them.

The data is being recieved quickly, so I know it’s not the connection to our remote oracle server and there are no lazy loaded relationships in the model I’m using, yet each record is taking 120-300ms to process a simple 3 field output with an action link.

Currently it takes over 3 minutes to load the page with 800ish records.

I’ve tried tweaking with configuration options but none seem to help.

Anyone has any ideas?

edit: controller code

readonly OracleSampleManagerContext db = new OracleSampleManagerContext();

public virtual ActionResult Index()
{
        var spList = db.SamplePoints.OrderBy(e=>e.Id).ToList(); 
        return View(MVC.Reports.Views.SamplePointList, spList);
}

    <h2>
    Selection By Sample Point
</h2>

<table>
@foreach (var sp in Model)
{
        System.Diagnostics.Stopwatch sw = new  System.Diagnostics.Stopwatch();
        sw.Start();

    <tr>
        <td>@Html.ActionLink(sp.Id, MVC.Reports.Results(sp.Id))</td>
        <td>@sp.Description</td>
        <td>@sp.PointLocation</td>
        <td>@sw.ElapsedMilliseconds</td>
    </tr>

    sw.Stop();
    sw.Reset();
}

</table>

Example:

0200    72" Sewer to river - Once through cooling water     OUTFALLS    346ms
0400    66" Sewer to river - Combined effluent  OUTFALLS    347ms
0500    54" Sewer to river - Once through cooling water     OUTFALLS    388ms
06-AI-18    TBA in Water    IB2     228ms
06-AI-31    TBA in Water    IB2     172ms
  • 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-26T10:39:54+00:00Added an answer on May 26, 2026 at 10:39 am

    My guess is that MVC.Reports.Results(sp.Id) does some sort of db lookup, and since you converted your model to a list before sending it to the view, you now have to hit the database again for each record Making a page of 800 records require 801 seperate trips to the database instead of one.

    1. Remove the ToList() from your first query.
    2. Refactor MVC.Reports.Results(sp.Id) to take an object instead of an int, and within that method work on the object directly.

    Both of the above may require you to move the scope of your entities context from within the action out to the Controller.

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

Sidebar

Related Questions

I am currently using ASP.NET MVC and Entity Framework Code First using the repository
Im currently using vs2008 with asp.net mvc framework for web development. Im missing a
I am using ASP.NET and the Entity Framework to make a website. I currently
I'm building an ASP.NET MVC 3 site using the code-first Entity Framework 4 approach.
I am currently programming a ASP.NET MVC3 application, using Entity Framework 4. There are
I'm currently developing an app using ASP.NET MVC3 and Entity Framework 4.1 Code First
I'm using Entity Framework 4 Code First in my .net MVC 2.0 project and
I am using Entity Framework code first and ASP.NET MVC 3. I have the
I'm currently working on an Intranet application project, using ASP.NET MVC 3. One of
I am currently using the EntityFramework to bind my ASP.NET MVC project to a

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.