我的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,但我仍然有问题。你可以让我知道它是用于网络设置还是我当地的mochine或其他什么?你能不能帮助我。