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.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…