How to set isolation level on SqlCommand/SqlConnection initialized with no transaction

前端 未结 5 1509
忘了有多久
忘了有多久 2020-12-03 10:18

The following method is supposed to peroform a dirty read on an open connection. There are no transactions. Where do I set IsolationLevel?

public string DoDi         


        
5条回答
  •  误落风尘
    2020-12-03 11:05

    On the BeginTransaction method: (MSDN link)

    And if you just want to use hints in your SP at the table level, use WITH(NOLOCK) - but use at your own risk.

提交回复
热议问题