Chris Anderson wrote: > Basically..Am I going overkill on the Dispose methods?
Not at all. If a class implements IDisposable, that means it wants to call Dispose the absolute moment you're through. In the case here, it means database connection resources are returned to the pool to be used by others. I believe (thought I have not tested) that if you weren't calling Dispose there, you would soon run out of connection resources and connections to the database would fail. > I can't find anything in the docs about it (just that Dispose should be > called if it exists, and you're finished with it) and the ADO.NET books I've > looked through rarely call Dispose at all (perhaps with the same reasoning > that error handling is rarely shown in books..to make the point of the > example clear) This would be a significantly damning statement about an ADO.net book that didn't call Dispose (or at least Close). Something like that should always, always be done. Brad -- Read my web log at http://www.quality.nu/dotnetguy/ You can read messages from the DOTNET archive, unsubscribe from DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.