当前位置:编程学习 > C#/ASP.NET >>

iBatis.net中使用System.Transaction时报错不能连接数据库

使用Ibatis建立一个数据访问层,编写单元测试代码的时候,我启动了一个事务scope,但是执行testdeletebyid的Case的时候,会报错“Unable to open connection to "Microsoft SQL Server, provider V2.0.0.0 in framework .NET V2.0”

这有可能是什么原因?

[SetUp]
public void SetUp()
{
   salesTaxRateDbHandler = DaoFactory.GetSalesTaxRateDao();
   scope = new TransactionScope();
}

[Test]
public void TestDeleteById()
{
   //1. DeleteByID
   //2. SelectAllRecord
   Assert.AreEqual(initialRecordNumber, currentRecordNumber);
}

[TearDown]
public void TearDown()
{
    scope.Dispose();
} --------------------编程问答-------------------- 我也配到这个问题
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,