Reputation: 479
I am developing an application which consists of service, data layer(which is class library) and mvc project. I am using EF 5. My connection string is the following:
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. 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.)
Upvotes: 1
Views: 6178
Reputation: 2910
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"/>
Upvotes: 1