Click here to Skip to main content
15,896,323 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
No Entity Framework provider found for the ADO.NET provider with invariant name 'System.Data.SqlClient'. Make sure the provider is registered in the 'entityFramework' section of the application config file.
See http://go.microsoft.com/fwlink/?LinkId=260882 for more information."

Iam Using EntityFrameWork And This Is Error When Insert Record
My Project Is 4-Layer

What I have tried:

In BLL Layer App.Config :

<configuration>
<configsections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->


<startup>
<supportedruntime version="v4.0" sku=".NETFramework,Version=v4.5.2">

<entityframework>
<defaultconnectionfactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework">
<providers>
<provider invariantname="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer">



In DAL Layer App.Config :
<configuration>
<configsections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->


<startup>
<supportedruntime version="v4.0" sku=".NETFramework,Version=v4.5.2">

<entityframework>
<defaultconnectionfactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework">
<providers>
<provider invariantname="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer">



In Entities Layer App.Config :
<configuration>
<configsections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->


<startup>
<supportedruntime version="v4.0" sku=".NETFramework,Version=v4.5.2">

<entityframework>
<defaultconnectionfactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework">
<providers>
<provider invariantname="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer">



In Layer Show Form :
<configuration>
<configsections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->


<msfconfig>
<msfpluginsolvers>
<msfpluginsolver name="CplexLP" capability="LP" assembly="CplexPlugIn.dll" solverclass="SolverFoundation.Plugin.Cplex.CplexSolver" directiveclass="SolverFoundation.Plugin.Cplex.CplexDirective" parameterclass="SolverFoundation.Plugin.Cplex.CplexParams">
<msfpluginsolver name="CplexMILP" capability="MILP" assembly="CplexPlugIn.dll" solverclass="SolverFoundation.Plugin.Cplex.CplexSolver" directiveclass="SolverFoundation.Plugin.Cplex.CplexDirective" parameterclass="SolverFoundation.Plugin.Cplex.CplexParams">
<msfpluginsolver name="CplexQP" capability="QP" assembly="CplexPlugIn.dll" solverclass="SolverFoundation.Plugin.Cplex.CplexSolver" directiveclass="SolverFoundation.Plugin.Cplex.CplexDirective" parameterclass="SolverFoundation.Plugin.Cplex.CplexParams">


<startup>
<supportedruntime version="v4.0" sku=".NETFramework,Version=v4.5">

Posted
Updated 10-Aug-16 22:33pm
v3
Comments
njammy 11-Aug-16 4:09am    
Please show us the <entityframework></entityframework> section in your app.config/web.config.
misaqyrn9677 11-Aug-16 4:17am    
Hello njammy
Iam Improve Question
App.Config Set
Regards
Yarian

1 solution

C#
Try adding the following runtime assembly bindings:


<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900