如何配置NHibernate以使用< connectionStrings>中的连接字符串配置部分 [英] How to configure NHibernate to use connection string from <connectionStrings> configuration section

查看:77
本文介绍了如何配置NHibernate以使用< connectionStrings>中的连接字符串配置部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道如何配置NHibernate属性文件以使用配置元素中已指定的连接字符串吗?

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

推荐答案

我在google.com上找到了它:

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>

这篇关于如何配置NHibernate以使用&lt; connectionStrings&gt;中的连接字符串配置部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆