Click here to Skip to main content
15,906,341 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need to show 4000+ data in a gridview. i retrieve all of them using datatable and pass them in gridview. but system show this error after load 500-600 row in gridview -

The connection was reset

The connection to the server was reset while the page was loading.

The site could be temporarily unavailable or too busy. Try again in a few moments.
If you are unable to load any pages, check your computer's network connection.
If your computer or network is protected by a firewall or proxy, make sure that Firefox is permitted to access the Web.

i try different technique -

1. httpruntime executiontimeout="1800" maxrequestlength="51200"
2. adapter.SelectCommand.CommandTimeout = 1800;
3. Connection Timeout=1800 in connection string.

but noting happen. it works perfect in localhost but failed in live server

please help
Posted
Updated 7-Nov-13 1:14am
v2
Comments
thatraja 7-Nov-13 7:12am    
Include the code in your question
Dipankar Basu 7-Nov-13 7:16am    
dt = op.HeadOfficeStockReport(Procedure Name);
if (dt.Rows.Count > 0)
{
grdHeadOfficeStock.DataSource = dt;
grdHeadOfficeStock.DataBind();
}
else
{
grdHeadOfficeStock.DataSource = null;
grdHeadOfficeStock.DataBind();
}
thatraja 7-Nov-13 7:13am    
why No.1 technique is just blank in your question? what's that?
Dipankar Basu 7-Nov-13 7:15am    
sorry, now ok

1 solution

Your page/server not able to respond because of what you're doing. And increasing timeouts are also dirty trick which is not recommendable one.

That's not a good way to show that much data at a time in grid, End user won't like that much delay or hangs.,

Use paging/filtering while displaying the data.

In database side
SQL Server 2005 Paging Results[^]

In frontend
GridView Multiple Filter AJAX Control[^]
Repeater with Paging and Sorting Features[^]

Besides you should optimize your database. Check these
Top 10 steps to optimize data access in SQL Server: Part I (use indexing)[^]
Top 10 steps to optimize data access in SQL Server: Part II (Re-factor TSQL and apply best practices)[^]
Top 10 steps to optimize data access in SQL Server: Part III (Apply advanced indexing and denormalization)[^]
Top 10 steps to optimize data access in SQL Server: Part IV (Diagnose database performance problems)[^]
Top 10 steps to optimize data access in SQL Server: Part V (Optimize database files and apply partitioning)[^]
 
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