How do i solved Timeout Expired Error in ASP.net with Backend as SQL 2008
-
I am getting following server error in asp.net application, even i mentioned Max Pool Size="100" in web.config file Error : "Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may occurred because all pooled connections were in use and max pool size was reached."
-
I am getting following server error in asp.net application, even i mentioned Max Pool Size="100" in web.config file Error : "Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may occurred because all pooled connections were in use and max pool size was reached."
-
Yup. That was exactly what I was going to suggest. I ran into that problem where I had forgotten to close and dispose my SQL connections and the problem didn't show up until I had more people using the system.
-
We are using SqlHelper.cs so there is no need to open and close connection explicitly. :) I think the problem is from "For Loop" for(i=0;i<1000;i++) { here im writing code to insert into table. at this point SqlHelper open and close connection 1000 times and im getting the above error, it will work fine upto 130 iteration without error. }
-
Yup. That was exactly what I was going to suggest. I ran into that problem where I had forgotten to close and dispose my SQL connections and the problem didn't show up until I had more people using the system.
We are using SqlHelper.cs so there is no need to open and close connection explicitly. :) I think the problem is from "For Loop" for(i=0;i<1000;i++) { here im writing code to insert into table. at this point SqlHelper open and close connection 1000 times and im getting the above error, it will work fine upto 130 iteration without error. }
-
We are using SqlHelper.cs so there is no need to open and close connection explicitly. :) I think the problem is from "For Loop" for(i=0;i<1000;i++) { here im writing code to insert into table. at this point SqlHelper open and close connection 1000 times and im getting the above error, it will work fine upto 130 iteration without error. }
without seeing the code directly, I can't say for sure if that is your problem, but why don't you just code it by hand. (not using the helper). The basic idea is: Open a connection to the database create a SQLcommand which takes parameters Load the parameters while loop(more data to load) execute SQL command load new values in paramters end while close and dispose of connection and command object The idea is that you have made one connection to the database, created one command and loop around the command just changing the parameters. Just a thought. :rose: