"Carl Daniel [VC++ MVP]"
>//reset the variables
dbParameter = null;
dbCommand = null;
db = null;
Setting local variables to null serves no purpose other than deliberate
code bloat. The variables become available for collection after the last
reference (even before the method returns), so there's nothing to be
gained by setting them to null just before the method ends.
Even worse, setting them to null actually keeps them around longer. If
you're running in Release Mode, then the GC would clean those variables up
as soon as it hit the last line that references them. (In debug mode, this
isn't the case, as it would make debugging practically impossible, and so
they use scope instead).
By doing this, the originally poster is making that "last reference" further
down in the method, thereby extending the lifetimes of those variables.
--
Chris Mullins, MCSD.NET, MCPD:Enterprise
http://www.coversant.net/blogs/cmullins