Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to configure NHibernate to use connection string from <connectionStrings> configuration section

Tags:

nhibernate

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

like image 316
Matthias Hryniszak Avatar asked Jan 18 '09 18:01

Matthias Hryniszak


1 Answers

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>
like image 104
Matthias Hryniszak Avatar answered Nov 10 '22 14:11

Matthias Hryniszak