0

Unable to determine the provider name for provider factory of type 'System.Data.EntityClient.EntityProviderFactory'. Make sure that the ADO.NET provider is installed or registered in the application config.

I am trying to do simple query to database:

var log =
     _logDb
     .Logs
     .Where(l => l.CustomerId == item.CustomerId)
     .FirstOrDefault();

Connection string: http://pastebin.com/ngqB9Q6L

The thing is when I quickwatch base context (values) there is no database. It is empty (I will get pic soon if needed).

Web.config: http://pastebin.com/xp4iKnta

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
sensei
  • 7,044
  • 10
  • 57
  • 125
  • 1
    Please post the app/web.config here. Your connection string looks very wrong though, was that auto-generated or did you put that in? – Ron Beyer Dec 09 '15 at 19:17
  • The connection string looks fine to me except for the data source part. `data source=xxx,65335;` Are you specifying a port after the comma? What is `xxx` suppose to be? Btw, you can write that as `.FirstOrDefault(l => l.CustomerId == item.CustomerId);` – Blue Eyed Behemoth Dec 09 '15 at 19:29
  • 1
    @RonBeyer: the connection string is fine - it's a default Entity Framework connection string with an `.edmx` model (database- or model-first approach) – marc_s Dec 09 '15 at 19:53
  • I was comparing it with my code-first one and thought that the `"`'s looked a little odd in there, but I'll take your word for it @marc_s – Ron Beyer Dec 09 '15 at 19:56
  • 1
    Is there any chance that you have your EF artifacts in a class library and then reference that from another project, like a console app for example? If so, look at the following post: http://stackoverflow.com/questions/18455747/no-entity-framework-provider-found-for-the-ado-net-provider-with-invariant-name – David Tansey Dec 09 '15 at 20:23

0 Answers0