Using xml in my c# application


I have this:

            "<Node Id=" + "3" + " ParentId=" + "1" + ">" + "\r\n" +
I use this line above to display it in a textbox.
Only I need to display the " too
(I don't know how you call " in english)
So it has to be something like this:

""3"" but with this I get an error.

How can i display the "-sing in my textbox.

I hope I have explain this right. My English isn't very well.

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

&quot; instead of the " to escape it in XML
peterkiersAuthor Commented:
Don't understand what you mean. Can you give me an example

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

peterkiersAuthor Commented:
??? when i do that i get displayed in the textbox:

<Node Id=&quot;3&quot; ParentId=1>

and it should be

<Node Id="3" + ParentId="1">
Ariful AmbiaHead of MISCommented:

const char doubleQuote = '"';

Console.WriteLine("<controls:FormField Name={0}Strasse{0} LabelText={0}Strasse{0}>", doubleQuote);

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
peterkiersAuthor Commented:
With this I get an error:
"<Node Id=" + ""3"" <================
so when you write it to the textbox, either do a .Replace("&quot;", "\"") or HTMLEncode(myXML)
peterkiersAuthor Commented:
This works for me:

"<Node Id=" + doubleQuote + 3 + doubleQuote  etc...


500 points goes to NomanBD


Peter Kiers
Please review this:

Note the escape characters. To put these in XML, you have to escape them as specified and then un-escape them when you use them.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.