Click here to Skip to main content
15,900,725 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have table which contain 1000 records in sql server Database,

if it is taking 15 second to run a select a command and bind it's record in Gridview on page load event.

so is there any way to reduce this 15 second to 2 second for aboce situation
Posted

You can Use Sql paging to solve this problem
 
Share this answer
 
 
Share this answer
 
v2
Hi,

My suggestion for your requirement is

we cannot show entire 1000 records on single page.

I do my way for this situation like...

first I got 100 records from database and store into application variable

After that retrieve 101-200 records and then save in application variable.

if user wants more than that I just remove my first feteched results from application variable.

Make sure website don't waste time for retrieving data from database.


All the Best
 
Share this answer
 
I would also check the execution plan and make sure that you are not missing an index and/or your SQL is efficient.
Is this a simple select?
Are you calculating totals?
There is no way that a SQL server should take 15 seconds to return 1000 records...
 
Share this answer
 
v2
you can use data-pager or pagination to overcome this problem...
:)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900