简体   繁体   English

基础提供程序在打开时失败。 MVC

[英]The underlying provider failed on Open. MVC

I am developing an application which consists of service, data layer(which is class library) and mvc project. 我正在开发一个由服务,数据层(即类库)和mvc项目组成的应用程序。 I am using EF 5. My connection string is the following: 我正在使用EF5。我的连接字符串如下:

add name="PicknickDBEntities" 
     connectionString="metadata=res://*/Model.csdl|res://*/Model.ssdl|res://*/Model.msl;
     provider=System.Data.SqlClient;
     provider connection string="
     data source=*******\SQLEXPRESS;
     initial catalog=PicknickDB;
     integrated security=True;
     User Instance=True;
     MultipleActiveResultSets=True;
     App=EntityFramework"
     " providerName="System.Data.EntityClient" />

I just copied this one from the service web.config but it is not working under the IIS. 我只是从服务web.config复制了此文件,但在IIS下无法正常工作。 Any ideas? 有任何想法吗?

PS(I know that this question appears at least a few times with good solutions but I wasn't unable to find the correct one for me.) PS(我知道这个问题至少出现了好几次,但有很好的解决方法,但我无法为我找到正确的问题。)

Try something along these lines. 尝试以下方法。

     <add name="LeaveMSContext"
    connectionString="Data Source=*******\SQLEXPRESS; 
    Initial Catalog=NAMEOFYOURDATABASE; Integrated Security=True;
    AttachDbFilename=|DataDirectory|DATABASEFILE.mdf 
    MultipleActiveResultSets=True; "
    providerName="System.Data.SqlClient"/>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Parallel.ForEach中:基础提供程序在打开时失败。 使用EF5 - in Parallel.ForEach : The underlying provider failed on Open. with EF5 实体框架给出异常:“底层提供程序在打开时失败。” - Entity Framework giving exception : “The underlying provider failed on Open.” 带有 Unity 的实体框架“底层提供程序在 Open 上失败”。 - Entity framework with Unity “The underlying provider failed on Open.” 内部异常 #1:MSG:底层提供程序在打开时失败。 在服务器上 - INNER EXCEPTION #1: MSG: The underlying provider failed on Open. On Server 错误:基础提供程序在打开时失败。 怎么解决呢? - Error: The underlying provider failed on Open. How to resolve it? 错误:基础提供程序在打开时失败。 用户的system.data.sqlclient.sqlexception登录失败 - Error: the underlying provider failed on open. system.data.sqlclient.sqlexception login failed for user MVC连接错误:基础提供程序在打开时失败 - MVC Connection Error : The underlying provider failed on Open System.Data.Entity.Core.EntityException:“基础提供程序在打开时失败。” 错误? - System.Data.Entity.Core.EntityException: 'The underlying provider failed on Open.' Error? 使用 TopShelf 的 Windows 服务:底层提供程序在打开时失败。 用户登录失败 - Windows service using TopShelf: The underlying provider failed on Open. User logon failure 基础提供程序在打开时失败 - The underlying provider failed on Open
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM