我有以下编码的 WCF 服务:
using (TransactionScope transScope = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions { IsolationLevel = System.Transactions.IsolationLevel.ReadUncommitted }))
{
security = new Security(GetConnection(SecurityConstants.DatabaseName));
int userExists = security.UserRegistered(UserID,Pass);
transScope.Complete();
}
我在 DBA 层有相同的方法来运行 IExecuteResult 查询,如您在此处看到的:
[Function(Name = SecurityConstants.SP_Name)]
public UserRegistered<IntegerOutput> IsUserExist(
[Parameter(Name = "USERID", DbType = "VarChar(15)")] string userID,
[Parameter(Name = "pass", DbType = "VarChar(25)")] string pass
)
{
IExecuteResult result = this.ExecuteMethodCall(this,((MethodInfo) (MethodInfo.GetCurrentMethod())), userID, pass);
return ((ISingleResult<IntegerOutput>)(result.ReturnValue));
}
此外,我检查了 MSDTC 的配置,但是当我运行我的应用程序时,它面临“与底层事务管理器的通信失败”错误。我在本地机器和服务器端启用了 DTC,但我仍然有问题。你能告诉我它是用于网络设置还是我的本地机器或其他东西?请你帮助我好吗。