-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: nhibernate config problem
PostPosted: Wed Jun 08, 2011 9:57 am 
Newbie

Joined: Tue Jun 22, 2010 2:03 pm
Posts: 1
Hello all.

I'm having trouble setting things up for a windows application I'm using
in order to do table mappings in nhibernate.

My App.config is set up as :

***************************************************


<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="hibernate-configuration"
type="NHibernate.Cfg.ConfigurationSectionHandler, NHibernate"/
</configSections>

<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<session-factory>
<property name="hibernate.connection.provider">
NHibernate.Connection.DriverConnectionProvider
</property>
<property name="hibernate.connection.driver_class">
NHibernate.Driver.SqlClientDriver
</property>
<property name="hibernate.connection.connection_string">
Server=bsp-appdevxxx;Database=BSPDataCenter;User Id=runprog;Password=xxxxxxxxx
</property>
<property name="hibernate.dialect">
NHibernate.Dialect.MsSql2005Dialect
</property>
<property name="show_sql">
false
</property>
</session-factory>
</hibernate-configuration>
</configuration>

****************************
Using session to do the work:

*******************************

ISessionFactory sessionfactory;

Configuration config = new Configuration();
config.AddAssembly(typeof(classname).Assembly);
sessionfactory = config.BuildSessionFactory();


***********************************


The final statement (BuildSessionFactory) results in the error

"The hibernate.connection.driver_class must be specified in the NHibernate configuration section."

even though I have it specified in the config file above

I'm sure the application is recognizing the App.Config, just not recognizing the properties designated within.

Any ideas?


Thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.