0

My error message states

The underlying provider failed on Open

and the InnerException states that the database cannot open by the requested login.

The strange thing is that my connectionString is showing a different login than what's mentioned in the error. Why is the application using an incorrect connectionString than the one that's explicitly defined in my App.Config?

2
  • Could you paste that section of the App.config? Commented Nov 4, 2014 at 20:14
  • 2
    How many projects are there in your solution? Which project has the app.config file, and which project has the WPF or web pages? The connection string should be in the same project as the one that has the user interface. Commented Nov 4, 2014 at 20:16

1 Answer 1

1

Few common reasons why:

1) You aren't using that project as your StartUp Project

2) You didn't match the name in the config

<connectionStrings>
    <add name="YourContext"... >
</connectionStrings>

3) You are hard coding it in the YourContext.cs

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.