Last post Jan 21, 2015 03:17 AM by Mikesdotnetting
Jan 21, 2015 02:48 AM|bsurendiran|LINK
We have developed an ASP.NET application using Telerik RadGrid.
The following are the Functionalities we have implemented and which gives performance issues
Issue 1 : Grid Load Performance issue with current code:-
The performance issue which we are facing here is while doing pagination the grid takes long time to bind.
Need help,suggestions and recommendation from the forum experts on this
Issue 2 : Excel write and excel upload performance issue with current code:-
Issue : Now the issue is excel upload and download takes long time and some times we are getting unhandled exception and httphandler timeout exception
Please help us..
we are ready to change the approach...
Jan 21, 2015 03:17 AM|Mikesdotnetting|LINK
Is it good practices to have more records in the viewstate just for the sake of avoid the database calls
Absolutely not. First, you are extracting way more data than you need, and adding that to every request in an encrypted format. It will be a performance killer. A database call that gets just the records you need will not kill performance.
Depending on your SQL Server version, use either ROW_NUMBER or OFFSET and FETCH to only bring back the data you need for the grid
SQL Server 2012 Offset And Fetch:
SELECT * FROM Products ORDER BY ProductId OFFSET 20 ROWS FETCH NEXT 10 ROWS ONLY
SQL Server 2005+ ROW_NUMBER:
;WITH x AS (SELECT *, ROW_NUMBER() OVER (ORDER BY ProductID) AS rownumber FROM Products)
SELECT * FROM x WHERE rownumber BETWEEN 21 AND 30
As to your Excel issue, I would read the content into a temporary table in SQL Server (using
OPENROWSET or similar, no need for DataTables at all) and then perform the comparisons using SQL Server rather than .NET. You can find all the records that have not changed by doing a simple