what is Enlist=false means in connection string for sql server?

前端 未结 2 446
耶瑟儿~
耶瑟儿~ 2021-01-12 02:58

I am a beginner with .net. I faced issue with the following error

\"The transaction operation cannot be performed because there are pending requests

2条回答
  •  灰色年华
    2021-01-12 03:46

    The MSDN says:

    The ConnectionString property supports a keyword, Enlist, which indicates whether System.Data.SqlClient will detect transactional contexts and automatically enlist the connection in a distributed transaction. If Enlist=true, the connection is automatically enlisted in the opening thread's current transaction context. If Enlist=false, the SqlClient connection does not interact with a distributed transaction. The default value for Enlist is true. If Enlist is not specified in the connection string, the connection is automatically enlisted in a distributed transaction if one is detected when the connection is opened.

提交回复
热议问题