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.
Microsoft FxCop has a rule checking that you use an IDisposbale in a using block.