Can I get a reference to a pending transaction from a SqlConnection object?

后端 未结 6 514
無奈伤痛
無奈伤痛 2020-12-30 18:51

Suppose someone (other than me) writes the following code and compiles it into an assembly:

using (SqlConnection conn = new SqlConnection(connString)) 
{
            


        
6条回答
  •  -上瘾入骨i
    2020-12-30 19:37

    In case where anyone faced this problem on .Net 4.5 you can use Transaction.Current in System.Transactions.

提交回复
热议问题