Entity Framework ASP.NET WEB API on remote server

asp.net-web-api c# entity-framework-6

Question

I have deployed my WEB API EF6 in remote IIS server. It is failed to access remote DB server db.Database.Exists() returns false . Whereas in my local PC it is working fine and able to connect the DB and db.Database.Exists() returns true.

What changes should I do in the ConnectionString. My connectionstring looks like this:

<add name="myconnstring" connectionString="metadata=res://*/Models.InformationSystem.csdl|res://*/Models.InformationSystem.ssdl|res://*/Models.InformationSystem.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=server01;Initial Catalog=myDB;Persist Security Info=True;User ID=abcd;Password=abcd;initial catalog=myDB;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient"/>
1
0
9/27/2018 5:19:25 AM

Popular Answer

If your DB is on a different box than your development box and that connection string works, then there is nothing wrong with the connection string. The issue would be in either authorization or actual connectivity from the IIS server to the DB server. Without knowing your network structure and/or the specific error message, more specifics can't be offered.

0
9/27/2018 1:00:41 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow