I'm using EF6 Code First. When performing the "Update-Database" the bank is created normally. But entering the data throws the following error:
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.
In Web.config I put the connection string with the provider:
<connectionStrings>
<add name="StringSqlServerConnection" connectionString="Data Source=NOTE-RAPHAEL\SQLEXPRESS;Initial Catalog=ProjetoTesteDb;Integrated Security=True" providerName="System.Data.SqlClient" />
</connectionStrings>
I put this configuration below that I saw in a tutorial from Microsoft, but with that the program did not even open:
<configSections>
<section name="entityFramework"
type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.3.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</configSections>
Connection class:
public class AppContext : DbContext
{
public AppContext()
: base("StringSqlServerConnection")
{ }
...
}
I have other projects that have the same configuration and I had no problem.