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

[亡魂溺海] 提交于 2020-01-22 18:51:13

问题


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


回答1:


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>


来源:https://stackoverflow.com/questions/455664/how-to-configure-nhibernate-to-use-connection-string-from-connectionstrings-co

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!