0

I have a table named Employee in my database PragimTech, and two classes Employee and EmployeeContext in my Models folder. My connection string in web.config is as follows:

<connectionStrings>
<add name="EmployeeContext" connectionString="data source=GAURAV-PC/SQLEXPRESS; initial catalog=PragimTech; integrated security=SSPI"
     providerName="System.Data.SqlClient"/>

When I run my application, i recieve a ProviderIncompatibleException saying

The provider did not return a ProviderManifestToken string

I am unable to find the bug. Please help.

tereško
  • 58,060
  • 25
  • 98
  • 150
Gaurav Ahuja
  • 885
  • 1
  • 7
  • 11
  • 1
    possible duplicate of [EF 4.1 exception "The provider did not return a ProviderManifestToken string"](http://stackoverflow.com/questions/5423278/ef-4-1-exception-the-provider-did-not-return-a-providermanifesttoken-string) Did you check all the questions and answers about this exception? I believe it's the EF exception with the most hits you'll get when searching for it. – Slauma Oct 06 '13 at 11:21
  • Thanks mate. Just one more thing I need to ask: do i need to keep the properties of the Employee class with the same name as the columns of my table Employee? – Gaurav Ahuja Oct 06 '13 at 11:51
  • No, you don't. You can map property names to column names (data annotations or Fluent API). Search for "Entity Framework Column attribute HasColumnName" or something like that. – Slauma Oct 06 '13 at 11:59

1 Answers1

0

This topic could be helpfull for you.

Check your InnerException for more details about error.

Community
  • 1
  • 1
whoah
  • 4,363
  • 10
  • 51
  • 81
  • Thanks mate. Just one more thing I need to ask: do i need to keep the properties of the Employee class with the same name as the columns of my table Employee? – Gaurav Ahuja Oct 06 '13 at 11:50
  • If you're using `CodeFirst` EF, it is good practise to keep the same properties name as columns name, so answer is - yes. Of course you could change columns name with `DataAnnotations` or `FluentAPI`, but it is not necessary. – whoah Oct 06 '13 at 11:58