Last post Jul 25, 2013 01:12 AM by Gluups
Jul 24, 2013 04:23 PM|Gluups|LINK
An administrator has set me a database password that contains an ampersand character (&).
This interupts the interpretation of the password, and Asp.Net does not know what to do with what appears between this character and the following column, which in fact is the end of the password.
As a results, the site is in error 500 and I had to search a few hours by inserting elements of the Web.config one by one.
Is is possible to escape a character in those conditions ? I tried URL encoding, as %26, but the only effect was that the connection string, including the password, appeared in clear on the web page, in an exception display.
Any better idea ?
Something strange : at a moment, that password was read properly, but I am unable to reproduce the same conditions.
Jul 24, 2013 04:29 PM|smirnov|LINK
Did you try to replace it by "&" instead of "&"?
<add key="myConnectionString" value="server=localhost;database=myDb;uid=myUser;password=my&Pass;" />
Hope this helps.
Jul 24, 2013 05:22 PM|oned_gk|LINK
Jul 24, 2013 11:57 PM|Gluups|LINK
Well, thank you very much, & did it.
The numeric value gave a false password, but because I did not use the good one : I had a look in the Windows characters tab, where I saw U0026, so I tried  , and it was not good.
I take good note of the table you gave me.
Jul 25, 2013 12:57 AM|oned_gk|LINK
Jul 25, 2013 01:12 AM|Gluups|LINK
Create connection string using SqlDataSource configuration wizard in design view mode. Add sqldatasource1 to a page in design mode, configure it, add some test query. Don't forget to save the connection when asked.
You know, this is what I did on the development machine (and in my password I did not put a character I did not how to cope with).