John,
There is only one reason I can think of where adding command dispose would
seem to fix your problem, and since it does not really fix it I need to ask.
Are you closing your connection in a Finalizer (destructor)?
This is one of the most common problems with people starting to use the .net
framework and we have not done a very good job of putting out the message,
you cant use finalizers to clean up managed resources, period.
If you are disposing the connection in a finalizer you will get stress
related errors in production, this problem was so bad that I had to add the
following comment to SqlConnection Close documentation:
http://msdn.microsoft.com/library/d...tasqlclientsqlconnectionclassdisposetopic.asp
CAUTION Do not call Close or Dispose on a Connection, a DataReader, or
any other managed object in the Finalize method of your class. In a
finalizer, you should only release unmanaged resources that your class owns
directly. If your class does not own any unmanaged resources, do not include
a Finalize method in your class definition. For more information, see
Programming for Garbage Collection.
Hope this helped,