如何将nHibernate与Sql Server 2008连接 [英] How connect nHibernate with Sql Server 2008

查看:228
本文介绍了如何将nHibernate与Sql Server 2008连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在某种程度上,我可以将其与sql 2000和sql 2005连接,但是我在Visual Studio 2010的sql 2008中进行了尝试,映射文件.hbm.xml中存在问题.在该项目中,我尝试使用最新版本的nHibernate 2.1.2和3.0.0的引用,但构建失败.
您能帮我一下,做些榜样吗?谢谢.

In some lession of nHibernate, i can connect it with sql 2000 and sql 2005, but i try hard in sql 2008 in Visual Studio 2010, problem in mapping file .hbm.xml. In that project i use try to use reference of last version nHibernate 2.1.2 and 3.0.0 but it not build sucessful.
Can you help me, and make some example. Thank you.

推荐答案

尝试使用相同的连接字符串但使用另一种数据访问技术(例如,纯ADO.NET)连接到服务器. 如果同样失败,则不是NHibernate问题.


您是否尝试过使用具有相同连接字符串的纯ADO.NET连接到数据库,并且工作正常吗?如果否,那么这将不是NHibernate问题.

这是我在SQL SERVER 2005/2008的十几个应用程序中使用的格式.

Try to connect to the server with the same connection string, but with another data access technology, for example pure ADO.NET.
If that fails as well, then it''s not a NHibernate problem.


Did you try to connect to the database with pure ADO.NET with the same connection string, and did it work? If no, then it can''t be a NHibernate problem.

This is the format i have used for over a dozen applications for SQL SERVER 2005/2008

data source=COMPUTERNAME;User Id=USERNAME;Password=PASSWORD;database=DATABASENAME



您的连接字符串正确吗?
http://www.connectionstrings.com/sql-server-2008



Is your connection string correct?
http://www.connectionstrings.com/sql-server-2008


这篇关于如何将nHibernate与Sql Server 2008连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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