SQL Express 2008 R2没有与NHibernate 2.0 RSS连接 [英] SQL Express 2008 R2 is not getting connected with NHibernate 2.0 RSS

查看:136
本文介绍了SQL Express 2008 R2没有与NHibernate 2.0 RSS连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用一个Windows服务,我正在使用NHibernate类。在这个文件中我设置了如下连接字符串:



private static void InitializeSessionFactory()

{

_sessionFactory = Fluently.Configure()

.Database(MsSqlConfiguration.MsSql2008

.ConnectionString(

@Server = MNARK2012\SQLEXPRESS; Database = monrk126; Integrated Security = SSPI;)



.Mappings(m =>

m.FluentMappings

.AddFromAssemblyOf< resident>())

.ExposeConfiguration(cfg => cfg.SetProperty(adonet.batch_size,100))

.BuildSessionFactory();

}



这个连接字符串在NHibernate中用于设置与SQL Express 2008 R2的连接时,它没有得到连接的。但是当我在NHibernate中使用相同的连接字符串并使用SQL SERVER 2008而不是SQL Express时,它的工作原理非常好。



请帮我解决此错误。



谢谢&此致,

Mukesh Bhagat

I am using a windows service in which i am using a class NHibernate. In this file i have set the connection string as below:

private static void InitializeSessionFactory()
{
_sessionFactory = Fluently.Configure()
.Database(MsSqlConfiguration.MsSql2008
.ConnectionString(
@"Server=MNARK2012\SQLEXPRESS; Database=monrk126;Integrated Security=SSPI;")
)
.Mappings(m =>
m.FluentMappings
.AddFromAssemblyOf<resident>())
.ExposeConfiguration(cfg => cfg.SetProperty("adonet.batch_size", "100"))
.BuildSessionFactory();
}

This connection string when used inside NHibernate for setting up connection with SQL Express 2008 R2, it's not getting connected. But when i use the same connection string inside NHibernate and use SQL SERVER 2008 instead of SQL Express, it works perfectly fine.

Kindly help me out to resolve this error.

Thanks & Regards,
Mukesh Bhagat

推荐答案

确保在SQL服务器上启用网络,请参阅此处:http://technet.microsoft.com/en-us/library/hh231672.aspx [ ^ ]
Make sure networking is enabled on your SQL server, see here : http://technet.microsoft.com/en-us/library/hh231672.aspx[^]


这篇关于SQL Express 2008 R2没有与NHibernate 2.0 RSS连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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