ConnectionString - space at end of password?

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?
 
A

Aidy

Are you using the Trim function on the password variable anywhere? Also are
you folling the password with a semi-colon?

pwd=password ;
 
H

Hans Kesting

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
 
C

Chris Ashley

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top