gpt4 book ai didi

c# - sql server 的连接字符串中的 Enlist=false 是什么意思?

转载 作者:太空狗 更新时间:2023-10-29 20:04:21 24 4
gpt4 key购买 nike

我是 .net 的初学者。我遇到以下错误的问题

"The transaction operation cannot be performed because there are pending requests working on this transaction.".

我在博客的某处读到。我在连接字符串中附加了 enlist=true,问题已解决。

注意:我正在将我的数据库从 sql server 2005 升级到 sql server 2008R2。

请帮助理解使用 enlist 的重要性。

最佳答案

征集是Distributed Transaction的用户

The Connection object will automatically enlist in an existing distributed transaction if it determines that a transaction is active. Automatic transaction enlistment occurs when the connection is opened or retrieved from the connection pool. You can disable auto-enlistment in existing transactions by specifying Enlist=false as a connection string parameter for a SqlConnection, or OLE DB Services=-7 as a connection string parameter for an OleDbConnection.

注意 在调用EnlistDistributedTransaction 之前,连接必须打开

这是一个给你的例子 Enlist=False;

关于c# - sql server 的连接字符串中的 Enlist=false 是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35716193/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com