Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Escape & in App.config

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?

like image 480
developer747 Avatar asked Jun 04 '12 15:06

developer747


People also ask

What do you mean escape?

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.

What is the synonyms of escape?

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.

What escape life means?

Definition of escape with one's life : to avoid death She narrowly escaped with her life.

What is an example of escape?

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.


1 Answers

Escape the ampersand by using &amp; in place of the &

As an FYI, see here for further characters: What characters do I need to escape in XML documents?

like image 79
jglouie Avatar answered Sep 19 '22 06:09

jglouie