Refactoring ADO.NET - SqlTransaction vs. TransactionScope

前端 未结 6 658
悲哀的现实
悲哀的现实 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 00:44

    Ok, maybe is too late for this... but Anyway, I will write it down for those interested...

    Since I have a better picture now, after having a lot of difficulties with my current SqlTransaction based approach which I might change in favor of TransactionScope, as I see it... main advantage of TransactionScope is that it can be used very easily in the Business Layer.

提交回复
热议问题