I was wondering if there was some sort of cheat sheet for which objects go well with the using statement... SQLConnection
, MemoryStream
, etc.
Taking it one step further, it would be great to even show the other "pieces of the puzzle", like how you should actually call connection.Close()
before the closing using statement bracket.
Anything like that exist? If not, maybe we should make one.
Perhaps glance at my post on this at http://www.lancemay.com/2010/01/idisposable-cheat-sheet/. Not sure if that's what you're looking for, but based on the original question, it sounds like it may be.