user8231474
user8231474

Reputation:

System.Data.ProviderIncompatibleException in Entity Framework

Is there any thing missing in my connection string so that i am getting this error:

An exception of type 'System.Data.ProviderIncompatibleException' occurred in EntityFramework.dll but was not handled in user code Additional information: An error occurred while getting provider information from the database. This can be caused by Entity Framework using an incorrect connection string. Check the inner exceptions for details and ensure that the connection string is correct.

This is my connection String in web.config:

<connectionStrings>
    <add name="OnlineStoreEntities" connectionString="Data Source=SERVERNAME\SQLEXPRESS;Initial Catalog=MVCOnlineShop;Integrated Security=True" providerName="System.Data.SqlClient" />
  <add name="MVCOnlineShop" connectionString="metadata=res://*/Models.ShopModel.csdl|res://*/Models.ShopModel.ssdl|res://*/Models.ShopModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=AHMADZAKARIA-PC;initial catalog=MVCOnlineShop;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
  </connectionStrings>

Upvotes: 1

Views: 4057

Answers (1)

Rahul
Rahul

Reputation: 77876

Check your connection string in *.config file and most probably you are missing the providerName="System.Data.SqlClient". See Entity Framework Config File Settings for more information

Upvotes: 3

Related Questions