本文介绍了nhibernate-从域对象创建数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是新来的冬眠.我阅读了一篇文章,并据此尝试使用域对象创建数据库.
我的配置文件:
Hi,
I am new to nhibernate. I read an article and according to it I tried to create db with domain object.
My config file :
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<session-factory>
<property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
<property name="dialect">NHibernate.Dialect.MsSql2005Dialect</property>
<property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property>
<property name="connection.connection_string">Server=FADIK-TOSH\SQLEXPRESS;Database=DatabaseNHB;Trusted_Connection=True;</property>
<!--<property name="connection.connection_string">Data Source=DatabaseNHB.mdf</property>-->
<property name="show_sql">true</property>
<!-- we want to see the SQL NHibernate generates and sends to the database (highly recommended for debugging purposes during development) -->
</session-factory>
</hibernate-configuration>
我的sql服务器是默认的,因此没有sql服务器身份验证.我使用Windows身份验证登录.
但是我无法创建数据库.
错误是:登录请求"Cannot open database "DatabaseNHB"
.登录失败.
用户''fadik-TOSH\fadik
的登录失败."
My sql server is default so there is no sql server authentication. I login with windows authentication.
But I can not create db.
the error is : "Cannot open database "DatabaseNHB"
requested by the login. The login failed.
Login failed for user ''fadik-TOSH\fadik
''."
What is wrong?
推荐答案
这篇关于nhibernate-从域对象创建数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!