MS SQL


System.InvalidOperationException Error Timeout expired. in .NET when connecting to a database.
This is most likely because you have exceeded the maximum pool size for your SQL connection. In ADO.NET, connection strings are pooled by default. To avoid this error, you can use one of the following solutions:
  1. Clean up your code! It is especially important to call Close when you finish with a pooled connection to release it back into the pool.
  2. Raise the Max Pool Size. If you are getting this because you actually have more than 100 people hitting the same page at the same time, then you can set the minimum and maximum pool sizes by adding to your connection string code similar to the following:
    "min pool size=1; max pool size=100"
  3. Disable connection pooling. Add the following to your connection string to disable connection pooling:
    "pooling=false"
Note: Microsoft highly discourages you disable connection pooling for performance reasons.


Further Reading
http://samples.gotdotnet.com/quickstart/howto/doc/adoplus/connectionpooling.aspx