CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> .NET

 pagination not working with stored procedure

Print topic Send  topic

Author Message
bogdantc

Posts: 36
Posted: 04/01/2008, 1:43 AM

I am using ASP .NET 2.0 (C#) and for Grids that have a stored procedure as a datasource the pagination is messed up completely.

If I have stored procedure that returns 200 rows and put a page limit of 20 instead of showing me 10 pages it shows me only the first 2. Pressing last page button gets me to the next page and not to the last.

I tried everything I know to make it work yet nothing happened. Please help me if you know how to fix it.
_________________
Able was I ere I saw Elba
View profile  Send private message
CCT


Posts: 44
Posted: 04/10/2008, 11:17 AM

As I know, for optimization purposes, ADO.NET returns requested data in small parts. And there is no way to know number of records returned while they all are not fetched. In many cases, when query returns large datasets, it will be very time-cost operation.

Thats why CodeCharge Studio uses separate commands for calculating number of records. In case of table or SQL datasource type, count queries like 'SELECT COUNT(*) FROM (<YOUR QUERY>)' are generated automaticaly.

In case of stored procedures there is no way to build such query so you should create additional Stored Procedure for this purposes and manually add it to Count command into <PageName>DataProvider.cs page, <GridName>DataProvider() method.

_________________
Get more CodeCharge Studio builders at http://codechargetools.com
View profile  Send private message
bogdantc

Posts: 36
Posted: 04/10/2008, 3:18 PM

I have found a workaround but it's not convenient and also not applicable for my situation and for the development standards my company has. instead of using stored procedures i should use SQL statements as grid data source with parameters in the SQL code. but doing so, i will have unmanaged SQL code in CCS and I don't want that. I have all SQL code grouped into Visual Studio Database Project and I want it to remain managed only there. Also it's not applicable because I have dynamic SQL used in that stored procedure and it's just not working from CCS and it gives really funny errors.

To be honest I would have been expected that a tool like CCS is to have this issue solved before putting stored procedures as an option for components data sources. :-@ :-/ :-X
_________________
Able was I ere I saw Elba
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright 2003-2004 by UltraApps.com  and YesSoftware, Inc.