0

目前,当我尝试在Silverlight中使用默认的Business Template注册用户时,出现错误。基本上,我正在关注如何使用Silverlight构建业务应用程序的第9频道的教程。Silverlight中的身份验证问题 - 无法连接到SQL Server

An error has occurred while establishing a connection to the server.

(provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 5)

An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 1326)

我发现了一个博客,它标识了问题,并且遵循了每一步,但是我仍然遇到同样的问题。

这里是我的连接字符串: -

<add name="SIEventManagerEntities" 
    connectionString="metadata=res://*/EventManagerDBModel.csdl|res://*/EventManagerDBModel.ssdl|res://*/EventManagerDBModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=MONFU-PC;Initial Catalog=SIEventManager;Integrated Security=SSPI;MultipleActiveResultSets=True&quot;" 
    providerName="System.Data.EntityClient" /> 

任何帮助真的非常感激!

感谢

回答

0

添加 集成安全= TRUE; 到连接字符串,它应该工作。

1

更改集成安全性可以访问数据库,那么你应该得到连接的用户。

实施例:

<connectionStrings> 
    <add name="Doner.CMS" connectionString="Data Source=SQL2k8;Network Library=DBMSSOCN;Initial Catalog=Doner;User ID=myUser;Password=myPassword;"/> 
</connectionStrings> 
+0

嗨阿德曼,你的意思是在连接字符串?你能给我一个小例子吗? – Johann 2010-05-13 09:42:29

+0

@Johann:你可以看到我已经从ConnectionString中移除了集成安全性。 – 2010-05-13 10:14:11

+0

@Johann:另一件事发生在我身上,那就是机器名称。这是你连接的服务器吗?或者你的本地机器?如果是本地的,你也需要明显改变这一点。 – 2010-05-13 10:20:55

相关问题