Why use a using statement with a SqlTransaction?

前端 未结 9 1397
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-02 11:27

I\'ve been running into some problems concerning a SqlTransaction I\'m using in my code. During my Googling I see many people using a using statement with a SqlTransaction.<

9条回答
  •  误落风尘
    2020-12-02 11:44

    In addition to all that, it prettifies your code. Doesn't the 7 lines of code look better than the 14 lines? I breath a sign of relief every time I see a using block. It's like that little squirt of mist that comes out of that glad smelly thing. Mmm, I'm a pretty block of efficient code. Look at how well I manage memory and how pleasing I am to the eye.

提交回复
热议问题