3

I'm running into a problem using NHibernate 3.0 with SQL server 2008 in a asp.net 4.0 project. During the configuration task of NHibernate, the BuildSessionFactory() method raise an exception: "Unable to find the requested .Net Framework Data Provider. It may not be installed."

Here's the hibernate configuration file:

<?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>

What am I missing? I'm running VisualStudio 2010 SP1 on SQLServer 2008 R2 Express Edition, and I think the driver exist on the machine: making a new connection to the server from VS2010, it works fine, and making a new webproject, using the dataset over SQLServer 2008, with the same connection string, works fine as well.

What's wrong?

themarcuz
  • 2,573
  • 6
  • 36
  • 53

1 Answers1

2

You are trying to use MsSql2008Dialect with OracleDataClientDriver.

Do you see anything wrong with that? :-)

Use the correct driver and the problem will go away.

Diego Mijelshon
  • 52,548
  • 16
  • 116
  • 154
  • 2
    ahahaha, what a stupid question I posted! I posted the config file that gives me the problem, but I was going on checking the wrong config file, not used by the application, but correctly written :) Too tired, better go to bed earlier next time :) – themarcuz Jun 07 '11 at 10:08