ConnectionString - space at end of password?

  • Thread starter Thread starter Chris Ashley
  • Start date Start date
C

Chris Ashley

The password to our SQL Server was recently changed and now has a
space at the end of it. I've modified the Connection String in my
web.config, but it's throwing a 'Login failed for <user>' exception.
I'm assuming this is because of the space at the end of the password
as nothing else has changed... is there any solution from my end?
 
Are you using the Trim function on the password variable anywhere? Also are
you folling the password with a semi-colon?

pwd=password ;
 
Chris Ashley used his keyboard to write :
The password to our SQL Server was recently changed and now has a
space at the end of it. I've modified the Connection String in my
web.config, but it's throwing a 'Login failed for <user>' exception.
I'm assuming this is because of the space at the end of the password
as nothing else has changed... is there any solution from my end?

Try adding quotes around that password:
Password="pwd ";

the information in connectionstrings.com seem to suggest that as a
solution.

Hans Kesting
 
Chris Ashley used his keyboard to write :


Try adding quotes around that password:
Password="pwd ";

the information in connectionstrings.com seem to suggest that as a
solution.

Hans Kesting

Perfect, that solved it. Thanks Hans.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top