tags:

views:

1086

answers:

1

Hi,

does anybody know how to configure NHibernate properties file to use a connection string already specified in configuration element?

+6  A: 

I found it on google.com:

<connectionStrings>
 <add name="connection_string_name" connectionString="[connection string]"/>
</connectionStrings>

<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
 <session-factory>
  ...
  <property name="connection.connection_string_name">connection_string_name</property>
  ...
 </session-factory>
</hibernate-configuration>
Matthias Hryniszak