I've just start using NHibernate, and I'm trying to work with Northwind following the information on "Quickstart with IIS and Microsoft SQL Server" in the documentation.
I don't know why, but the configuration from the Web.Config was not worked well (There was an error says: "Please set the dialect"), so i tried to set the configuration in hbm.xml file:
Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<session-factory>
<property name="dialect">NHibernate.Dialect.MsSql2005Dialect</property>
<property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
<property name="connection.connection_string">Server=*****;catalog=Northwind;Integrated Security=True</property>
<mapping assembly="Northwind" />
</session-factory>
</hibernate-configuration>
When the configuration is loading i'm getting an error:
Code:
Configuration conf = new Configuration();
conf.AddFile(HttpContext.Current.Server.MapPath("~/hibernate.hbm.xml")); [b]<<<<< ERROR <<<<<[/b]
conf.AddFile(HttpContext.Current.Server.MapPath("~/Employee.hbm.xml"));
conf.Configure();
_SessionFactory = conf.BuildSessionFactory();
The error is:
Could not find schema information for the element 'urn:hibernate-configuration-2.2:hibernate-configuration'.
Google didn't help me:\
Does anyone knows what the problem?
Thanks.