Page 1 of 1

skip take pagination problem

Posted: Tue 29 Sep 2009 09:26
by Morpheus
Hello,

I mentioned in a previous message paging problem. Following the update dotconnect, my problem was solved. Off by investigating a little more, I found that the framework of the request by the code swap seemed odd.

Code: Select all

	
....
WHERE "Project1"."row_number" > 149
	ORDER BY "Project1".RAISONSOCIALE ASC
)  "top"
WHERE  ROWNUM <= (299) 
Why the last instruction is "rownum"? because in this case it brings me back 299 record. I was expecting 150 records.

Why the latest "rownum" is not made with the "row_numbre (row_number between 149 and 299)? since then I have 150 records.

Is it intentional or a mistake?

Posted: Wed 30 Sep 2009 07:29
by AndreyR
Judging from your previous code, your numLigneFin variable is the variable responsible for the number of the last line.
But when you call Take(numLigneFin), it takes the number of records to fetch, not the number of the last line to be fetched.
I recommend you to chnage the code in the following way:

Code: Select all

listeSociete = query.Skip ((int) numLigneDebut). Take ((int) numLigneFin - (int)numLigneDebut);