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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T20:20:10+00:00 2026-06-07T20:20:10+00:00

I’m getting different results displaying in my gridview than what appear when I debug.

  • 0

I’m getting different results displaying in my gridview than what appear when I debug.

Theres a search for a gridview which filters results and it only seems to work if numbers are under a few hundred.

Example, search for rank, where rank =='10' results in the stored procedure total 607 with all rank == 10. linq to sql results are exactly the same debugging.

when the results are bound to the gridview and displayed they appear to be correct until you get to page 10 of the results displayed and then the results are not correct, meaning the rank != 10

The results appear correct for smaller result sets.. not sure what’s going on.

here’s code

DataTable getEmployeeResults = employee.FullEmployeeRoster();
var results = (from row in getEmployeeResults.AsEnumerable()
        select new EmployeeRow
                {
                  EmployeeId = row.Field<int?>("EmployeeID"),
                  Rank = row.Field<string>("Rank"),
                  Name = row.Field<string>("Name"),
                  WorkEmail = row.Field<string>("Email"),
                  DutyStation = row.Field<string>("StationName"),
                  Directorate = row.Field<string>("Directorate"),
                  BranchService = row.Field<string>("Branch"),
                  Active = ConvertToBool(row.Field<int>("Active"))
                });


if (this.ddRank.SelectedValue != "")
{
    results = results.Where(x => x.Rank == this.ddRank.SelectedItem.Text);
}

if (this.chkInactive.Checked)
{
    results = results.Where(x => x.Active == false);
}
else
{
    results = results.Where(x => x.Active == true);
}

    this.gridEmployees.DataSource = results.ToList();
    this.gridEmployees.DataBind();
  • 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-07T20:20:11+00:00Added an answer on June 7, 2026 at 8:20 pm

    It is difficult to give a good answer here as the information provided is a bit unclear.

    I assume that the FullEmployeeRoster is the stored procedure that returns 607 records with all rank == 10. At least that’s what I gather from your description. If so, then why filtering by 10? However, if it returns all records then it could be filtering issue.

    Since it is IEnumerable we can rule out possible problems with SQL.

    Then to troubleshoot I would first output all results at once, preferably on page_load. Either disable pagination or simply iterate over all records with foreach and write them to response. That way you will know for sure if what comes back at runtime is what you need and eliminate possible issues with the grid and postbacks.

    Then I would check your pagination. Since it appears that you rely on a view state to do the pagination for you, I would make sure to check the size of it. The default max request length for post in .NET is set to 4MB (maxRequestLength = 4,096) yet it is conceivable that your web server is configured with a lesser value. That could corrupt it somehow. Although I think you’d be getting an exception in that case.

    Finally, I would disable the view state and instead retrieve all data on each pagination and simply do .Skip(…).Take(…). But I have a feeling there is missing information somewhere in your post.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I want use html5's new tag to play a wav file (currently only supported
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I'm new to using the Perl treebuilder module for HTML parsing and can't figure

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.