Note that there are some explanatory texts on larger screens.

plurals
  1. POSqlDataAdapter returns unexpected rows in SQL Server 2012
    text
    copied!<p>Short description of the situation.</p> <p>A web application where the user can choose some search criteria, hit the search button, and see the results displayed in a grid. </p> <p>This application works as expected on our development servers. However, when deployed on the customer's server, the paging of the grid is broken: the first page is correct, but next pages don't return the correct rows. I can only explain what happens with an example:</p> <p>Suppose page 1 should show results 1-10, page 2 results 11-20, etc.</p> <p>What happens is something like this: page 1 shows 1-10, page 2 shows 1,2,3,4,<strong>6</strong>, <strong>8</strong>,9,28,29,30 page 3 shows 1,2,3,28,29,36,37,.. </p> <p>So the rows are messed up, and a lot of results are never displayed (replaced by result from previous page). Also note that the rows are not just off by some number.</p> <p>After many hours of searching and debugging I can only conclude that the Fill() method of the SqlDataAdapter that's being used returns the wrong results! The adapter uses a SqlCommand, with an SQL query as plain text. I can run this query in SQL Server Management Studio, where it returns the correct results, so it really must go wrong inside the .NET framework itself.</p> <p>I've tried to enable .NET source debugging to step into the Fill method, but I can't get that to work, so basically I'm out of options now.. </p> <p>Any tips/suggestions are greatly appreciated!</p> <p>&lt; problem is solved, see answer below ></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload