Refactoring ADO.NET - SqlTransaction vs. TransactionScope

前端 未结 6 644
悲哀的现实
悲哀的现实 2020-12-04 23:58

I have \"inherited\" a little C# method that creates an ADO.NET SqlCommand object and loops over a list of items to be saved to the database (SQL Server 2005).

Right

6条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-05 01:02

    Just note using Transaction Scope sometimes we will much problem because many setting that we must do in Server like setting DTC, Firewall and etc. So I recommended using SqlTransaction is more save in implementation.

提交回复
热议问题