asp.net - NHibernate 问题 "Unable to find the requested .Net Framework Data Provider. It may not be installed. "

标签 asp.net sql-server nhibernate dataprovider

我在 asp.net 4.0 项目中使用 NHibernate 3.0 和 SQL Server 2008 时遇到问题。 在 NHibernate 的配置任务期间,BuildSessionFactory() 方法引发异常:“无法找到请求的 .Net Framework 数据提供程序。它可能未安装。”

这是休眠配置文件:

<?xml version="1.0" encoding="utf-8" ?>
<!-- NHibernate Configuration -->
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
  <session-factory>
    <property name="connection.provider">
      NHibernate.Connection.DriverConnectionProvider
    </property>
    <property name="dialect">
      NHibernate.Dialect.MsSql2008Dialect
    </property>
    <property name="connection.driver_class">
        NHibernate.Driver.OracleDataClientDriver
      </property>
    <property name="connection.connection_string">
      Data Source=localhost\sqlexpress;Persist Security Info=True;User ID=geoad;Password=xlns
    </property>
    <property name="show_sql">
      true
    </property>
    <property name="proxyfactory.factory_class">
      NHibernate.ByteCode.LinFu.ProxyFactoryFactory,NHibernate.ByteCode.LinFu
    </property>
  </session-factory>
</hibernate-configuration>

我错过了什么?我在 SQLServer 2008 R2 Express Edition 上运行 VisualStudio 2010 SP1,我认为驱动程序存在于机器上:从 VS2010 建立到服务器的新连接,它工作正常,并创建一个新的 webproject,使用 SQLServer 2008 上的数据集,使用相同的连接字符串,也可以正常工作。

怎么了?

最佳答案

您正在尝试将 MsSql2008DialectOracleDataClientDriver 一起使用。

你觉得有什么不对吗? :-)

使用正确的驱动程序,问题就会消失。

关于asp.net - NHibernate 问题 "Unable to find the requested .Net Framework Data Provider. It may not be installed. ",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6257309/

相关文章:

c# - 将 C# MVC 应用程序连接到远程 SQL Server 数据库

nhibernate - Fluent NHibernate 共享列的组件

asp.net-mvc - 在 MVC Controller 中引用存储库

asp.net - 为什么我的内联 asp.net 无法在 <link href> 中工作?

asp.net - 如何检查用户是否登录

asp.net - 从 JavaScript 读取 web.config

c# - 将字节数组从服务器传输到浏览器

sql - 每月计算新客户

c# - 在 SQL 中处理大量数据

NHibernate 析取导致 AND 查询而不是 OR