关于c# NHibernate数据库的连接,求助 20
NHibernate洞动态设置数据库连接时,提示》登录失败。该登录名来自不受信任的域,不能与Windows身份验证一起使用。连接代码:,求高人指点。。。在线等!!!(俺使...
NHibernate洞动态设置数据库连接时,提示》登录失败。该登录名来自不受信任的域,不能与 Windows 身份验证一起使用。
连接代码:
,求高人指点。。。在线等!!!(俺使用的是FluentNHibernate框架) 展开
连接代码:
,求高人指点。。。在线等!!!(俺使用的是FluentNHibernate框架) 展开
1个回答
2015-11-26
展开全部
NHibernate各种数据库连接参数文件配置方法说明
//配置文件Config/Hibernate.cfg.xml内容如下所示:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2" >
<session-factory name="CwfServer">
<property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property>
<property name="dialect">NHibernate.Dialect.MsSql2008Dialect</property>
<property name="connection.connection_string">server=192.168.1.244;database=wf_db_t;uid=sa;pwd=supersit.1;</property>
<property name="adonet.batch_size">10</property>
<property name="show_sql">true</property>
<property name="command_timeout">60</property>
<property name="hbm2ddl.auto">update</property>
<property name="query.substitutions">true 1, false 0, yes 'Y', no 'N'</property>
<!--<property name="proxyfactory.factory_class">NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu</property>-->
<mapping assembly="Net.NHibernateDB"/>
<mapping assembly="Cwfapi"/>
<mapping assembly="CwfEngine"/>
</session-factory>
</hibernate-configuration>
//配置文件Config/Hibernate.cfg.xml内容如下所示:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2" >
<session-factory name="CwfServer">
<property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property>
<property name="dialect">NHibernate.Dialect.MsSql2008Dialect</property>
<property name="connection.connection_string">server=192.168.1.244;database=wf_db_t;uid=sa;pwd=supersit.1;</property>
<property name="adonet.batch_size">10</property>
<property name="show_sql">true</property>
<property name="command_timeout">60</property>
<property name="hbm2ddl.auto">update</property>
<property name="query.substitutions">true 1, false 0, yes 'Y', no 'N'</property>
<!--<property name="proxyfactory.factory_class">NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu</property>-->
<mapping assembly="Net.NHibernateDB"/>
<mapping assembly="Cwfapi"/>
<mapping assembly="CwfEngine"/>
</session-factory>
</hibernate-configuration>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询