1

Connecting through Sql Server's Management Studio works, however, it will not connect through the web.config connection string.

<add name="cnString" connectionString="Data Source=(local); Initial Catalog=MyDB; User ID=andrewbb; Password=myPassword;" providerName="System.Data.SqlClient" />

It returns: Login failed for user 'andrewbb'. Reason: Password did not match that for the login provided. [CLIENT: ]

Both the password and user id are lowercase. Ideas?

3
  • Is it a windows ID or a SQL ID? If its an sql ID You may need to add "Integrated Security=false" Commented Sep 19, 2012 at 6:49
  • did you set the password and user name respectively of the MyDB database in the Sql Server's Management Studio? Commented Sep 19, 2012 at 6:49
  • are you in a domain? Is your SQL Server set to Windows Authentication mode only? (This can be checked in the Sever-Properties -> Security) Commented Sep 19, 2012 at 6:49

2 Answers 2

1

Your log-in details need to keep all the time. Include following in connection string to keep security info.

Persist Security = true

Refer : Difference Between Persist Security Info And Integrated Security?

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

1 Comment

Yes, this was the solution. Thank you.
0

Try adding NETWORK SERVICE account to the database

How to: Use the Network Service Account to Access Resources in ASP.NET

Check This

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.