Yagnesh.Dixit
Yagnesh.Dixit

Reputation: 318

Entity framework gives error underlying provider failed on open

I developed a web site on my local pc and local database using entity framework, Now I gave all the code to my client now the entity framework gives an error underlying provider failed on open I modified data source, initial catalog, user id and password of the connection string of entity framework but of no use please help. below is my connection string.

<add name="SBV_dbEntities" connectionString="metadata=res://*/SBVEntityModel.csdl|res://*/SBVEntityModel.ssdl|res://*/SBVEntityModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=.\SQLEXPRESS;initial catalog=yagnesh_db;user id=yagnesh;password=yagnesh@123;multipleactiveresultsets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" /> 

Upvotes: 1

Views: 1283

Answers (1)

Sampath
Sampath

Reputation: 65938

use like below.Give a connection string to the SQL server is as below (This is a sample code).

<add name="ContextName" connectionString="Data Source=ServerName;Initial Catalog=DBCatalogName;Integrated Security=True;MultipleActiveResultSets=True;App=EntityFramework"
   providerName="System.Data.SqlClient" />

e.g.

<add name="PawLoyalty" connectionString="Server=.;database=PawLoyalty;Trusted_connection=true;pooling=true;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />

I hope this will help to you.

Upvotes: 0

Related Questions