0

I have two projects, one containing WS which access to the DB and the other one is front-end. The two projects are deployed on seperate servers. Before Using EF and linq for accessing the DB in the WS project, everything was working fine, but after that I got and exception saying "the underlying provider failed on open". Please ca you help me with that. Thank you in advance. Here is my ConnectionString (WS Project):

<connectionStrings>

-->

<add name="ConString1" connectionString="Data Source=@address,1433;Initial Catalog = MpCarteCoBrandee;MultipleActiveResultSets=True;Trusted_Connection=True;"  providerName="System.Data.SqlClient"  />
<!--<add name="ConString" connectionString="Data Source=AOUS-PC;Initial Catalog=TestMobilePayment;Integrated Security=SSPI" providerName="System.Data.SqlClient" />-->
<add name="MobilePaymentEntities" connectionString="metadata=res://*/MobilePayment.csdl|res://*/MobilePayment.ssdl|res://*/MobilePayment.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=@address,1433;initial catalog=MobilePayment;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />

Hedi Jl
  • 29
  • 7
  • Could you please give us exception message? – Szer Jul 05 '16 at 12:06
  • Here it is : System.ServiceModel.FaultException`1[[System.ServiceModel.ExceptionDetail, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]: "the underlying provider failed on open – Hedi Jl Jul 05 '16 at 12:09
  • Probably production user doesnt have access to DB. This is common issue, [check this out](http://stackoverflow.com/questions/2475008/mssql-error-the-underlying-provider-failed-on-open). IIS user pool is a long story, you should read about it. – Szer Jul 05 '16 at 12:58
  • But I have accessed the database without EF!! that problem occured just after creating the edmx model and started using linq (Everything was working fine on local) – Hedi Jl Jul 05 '16 at 13:28
  • When you use it on local you access it with YOUR user. When you hosting it on IIS -> IIS access DB with HIS users which dont have rights to access db. It is not you anymore. You should give IIS users rights to access db – Szer Jul 05 '16 at 15:43

0 Answers0