[英]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.