I have the following piece of config in my App.config file:
<add key="ConnectionString" value="INITIAL CATALOG=myDatabase;DATA SOURCE=myServer;User ID=myUser;Password=!&myPass99;"/>
The above connection string is rejected by Visual Studio intellisense. It says entity myPass99
not defined. The problem is caused by the & in the password.
How do I escape it?
1 : to get away : get free or clear Everyone escaped from the burning building. 2 : to keep free of : avoid She managed to escape injury. 3 : to fail to be noticed or remembered by The name escapes me. 4 : to leak out Gas is escaping from the tank.
Some common synonyms of escape are avoid, elude, eschew, evade, and shun. While all these words mean "to get away or keep away from something," escape stresses the fact of getting away or being passed by not necessarily through effort or by conscious intent.
Definition of escape with one's life : to avoid death She narrowly escaped with her life.
The prisoners attempted a daring escape. He celebrated his escape from his boring job with a long vacation. She had a lucky escape when she wasn't injured in the accident. She managed to avoid serious injury, but it was a narrow escape.
Escape the ampersand by using &
in place of the &
As an FYI, see here for further characters: What characters do I need to escape in XML documents?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With