I\'ve written some tests for .net code that invokes calls to my SQL Server. It appears that using System.Transactions
is an excellent choice for rolling back any m
I found the problem. One of the methods I was testing uses a SqlDataReader
object. Apparently, the Close()
method must be called before the SqlDataReader
goes out of scope in order to release the connection, but in my case, I failed to do so.
Simply adding mySqlDataReader.Close()
to the end of the method under test fixed the problem. Also, the test method to test this particular method was data-driven with over 100 test cases, so that explains how I could have run out of connections.