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.
 
Back
Top