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?
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.
精彩评论