Fast Paging a .NET grid from an iSeries table
I recently wrote a simple grid view ASP.NET web application for a client displaying late paying customers. The SQL behind it though had to summarize and group across several different tables on the iSeries. The program worked well but the client complained that the app took too long to start up.
To speed things up, I put all the SQL into a stored procedure used a scrollable cursor and fetched 22 records at a time. FETCH NEXT FROM C1 FOR 22 ROWS
I shouldn't have done a select All - it took too long and left the customer hanging even though there wasn't much data behind it.