RSS

Entity Framework Exception “The underlying provider failed on Open”

02 Mar

When trying to query data from Entity Framework, my code always return the following error:

The underlying provider failed on Open.

Here’s the screenshot.

Turn out the problem was on the Connection String for the entity.

In the config file, we have to include “Password” parameter in “connectionString” attribute.

<connectionStrings>
    <add name="SomeEntities" connectionString="metadata=res://*/Models.DB.csdl|res://*/Models.DB.ssdl|res://*/Models.DB.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=SERVER\INSTANCE;Initial Catalog=Database;User ID=username;Password=password;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />
</connectionStrings>

Whoolaa, it works now!

UPDATE (03.07.2011): If you still see this error message when running on IIS, please read this post.

About these ads
 
7 Comments

Posted by on March 2, 2011 in General

 

Tags: , ,

7 responses to “Entity Framework Exception “The underlying provider failed on Open”

  1. Lloyd Hasson

    August 13, 2012 at 9:43 pm

    Wow, it worked! Thanks very much. Brilliant!

     
  2. sojansojanchandy

    March 3, 2013 at 10:40 pm

    it didnt work for me.i already password had any suggesssion

     
  3. Suresh Balaji

    July 7, 2013 at 10:44 am

    Thank you Boss!!!… Thanks for this useful info

     
  4. Suresh Balaji

    July 7, 2013 at 10:45 am

    it worked perfectly for me…

     
  5. Michael

    June 3, 2014 at 1:39 am

    Worked here too. Thanks a lot!

     
  6. Amit

    October 4, 2014 at 12:49 pm

    try changing application pool identity to network service

     

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.

Join 49 other followers

%d bloggers like this: