i am getting connection pooling error for my asp.net (3.5) application when deployed to the clients server. using a query (from googling) i found out one of my pages alone pumping around 56 connections to the server when it is opened, the page contains a nested gridview and it is having quite a large number of data around 2600 main grid data and n number of data in the child grid, the database in the client is sql server 2000 , what will be max connection pool setting in the web config , is there a way to overcome this problem.
-
not enough information to answer accurately, apart from fix your code...i.e. Fix the Real cause, not the Symptoms...Mitch Wheat– Mitch Wheat2011-03-08 04:45:50 +00:00Commented Mar 8, 2011 at 4:45
-
What is error you exactly getting?Muhammad Akhtar– Muhammad Akhtar2011-03-08 04:49:49 +00:00Commented Mar 8, 2011 at 4:49
-
Just see if you can get all the data for the page in a single connection and populate the datagrids on the code behind.The King– The King2011-03-08 04:57:02 +00:00Commented Mar 8, 2011 at 4:57
-
@Mitch , will post a screen shot of the error asap. @The King ,@Vinay C redesigning is on the cards, and @Vinay i think the 3 rd point you have made might be usefulsansknwoledge– sansknwoledge2011-03-08 05:13:18 +00:00Commented Mar 8, 2011 at 5:13
Add a comment
|
1 Answer
As @Mitch correcting pointed out, the better solution is not to adjust connection pooling setting up rather re-design your code so that it can work with single connection.
Current obvious issue is that every connection that you open should be closed immediately after your use them. But more than that you should consider below re-factoring:
- Try using single connection to get data for main grid and child grids. You might be firing multiple queries (resulting in multiple database trips).
- Next obvious step would be to fire multiple queries together or call to single sp that would fetch data for main grid and child grids together so that you reduce database trips to one.
- Next obvious step would to question if you need all this data together - for example, are you really planning to show 2600 rows at one time? If not then only fetch what you intend to show using database side paging.