-1

I am building an app for windows phone 7 application using c#.net. I was able to extract data from web service but suddenly i started getting an exception while calling web service.

The exception message is:

Server was unable to process request. ---> error connecting: Timeout expired.
The timeout period elapsed prior to obtaining a connection from the pool.
This may have occurred because all pooled connections were in use and max pool size was reached.

Can anyone tell me if this is an error caused because of coding or something else.
How can I fix this?

Ashley Medway
  • 7,151
  • 7
  • 49
  • 71
bhaku
  • 438
  • 4
  • 18
  • http://stackoverflow.com/questions/1642252/the-timeout-period-elapsed-prior-to-obtaining-a-connection-from-the-pool – Rob Feb 05 '14 at 07:26

1 Answers1

1

This error message is received when:

  1. So many people are connected to the web services that are not enough "free" connections.
  2. A SQL command is taking longer than the timeout of the SQL/Web Server.
  3. Your previous connections are not being properly disposed.

You can try:

  1. Increase the number of IIS connections available to the web service. Website.
  2. Increase the number of SQL connections available to the DB connection. Website.
  3. Write your SQL Commands better so they do not hit the timeout window.
  4. Properly call SqlConnection.Dispose when you are finished with each connection.
Community
  • 1
  • 1
Ashley Medway
  • 7,151
  • 7
  • 49
  • 71