Click here to Skip to main content
15,886,919 members
Home / Discussions / C#
   

C#

 
GeneralRe: Write and read a paragraph in XML format string ? Pin
taibc18-Nov-12 20:21
taibc18-Nov-12 20:21 
GeneralRe: Write and read a paragraph in XML format string ? Pin
n.podbielski18-Nov-12 21:06
n.podbielski18-Nov-12 21:06 
GeneralRe: Write and read a paragraph in XML format string ? Pin
taibc18-Nov-12 21:10
taibc18-Nov-12 21:10 
GeneralRe: Write and read a paragraph in XML format string ? Pin
n.podbielski18-Nov-12 21:19
n.podbielski18-Nov-12 21:19 
GeneralRe: Write and read a paragraph in XML format string ? Pin
taibc18-Nov-12 21:28
taibc18-Nov-12 21:28 
GeneralRe: Write and read a paragraph in XML format string ? Pin
n.podbielski18-Nov-12 21:34
n.podbielski18-Nov-12 21:34 
GeneralRe: Write and read a paragraph in XML format string ? Pin
taibc18-Nov-12 21:36
taibc18-Nov-12 21:36 
AnswerRe: Write and read a paragraph in XML format string ? Pin
PIEBALDconsult20-Nov-12 4:18
mvePIEBALDconsult20-Nov-12 4:18 
You're probably doing something wrong. I just tried it and had no trouble at all. Xml is perfectly capable of storing the text and giving it back.

You would need to show us the code you are using to determine what's wrong. Whatever the problem is, Replace isn't the best solution. Even if you think Replace is "good enough" for the particular program you're working on, it is not a good general solution and finding a better one will help you become a better developer.


P.S. What you posted will not produce well-formed XML if the user enters characters that aren't allowed. Try something like:

System.Xml.XmlNode nod = doc.CreateElement ( "Content" ) ;
nod.InnerText = this.textBox1.Text ;


Then write the nod.OuterXml to the database so any such characters get encoded properly.

modified 20-Nov-12 16:21pm.

GeneralRe: Write and read a paragraph in XML format string ? Pin
n.podbielski20-Nov-12 5:44
n.podbielski20-Nov-12 5:44 
GeneralRe: Write and read a paragraph in XML format string ? Pin
PIEBALDconsult20-Nov-12 6:29
mvePIEBALDconsult20-Nov-12 6:29 
GeneralRe: Write and read a paragraph in XML format string ? Pin
n.podbielski20-Nov-12 7:43
n.podbielski20-Nov-12 7:43 
GeneralRe: Write and read a paragraph in XML format string ? Pin
PIEBALDconsult20-Nov-12 10:45
mvePIEBALDconsult20-Nov-12 10:45 
GeneralRe: Write and read a paragraph in XML format string ? Pin
n.podbielski20-Nov-12 11:03
n.podbielski20-Nov-12 11:03 
GeneralRe: Write and read a paragraph in XML format string ? Pin
PIEBALDconsult20-Nov-12 13:45
mvePIEBALDconsult20-Nov-12 13:45 
GeneralRe: Write and read a paragraph in XML format string ? Pin
taibc20-Nov-12 14:30
taibc20-Nov-12 14:30 
GeneralRe: Write and read a paragraph in XML format string ? Pin
PIEBALDconsult20-Nov-12 17:08
mvePIEBALDconsult20-Nov-12 17:08 
GeneralRe: Write and read a paragraph in XML format string ? Pin
taibc20-Nov-12 17:33
taibc20-Nov-12 17:33 
GeneralRe: Write and read a paragraph in XML format string ? Pin
PIEBALDconsult20-Nov-12 18:08
mvePIEBALDconsult20-Nov-12 18:08 
Question[Help] C# .txt Pin
mumbot18-Nov-12 14:03
mumbot18-Nov-12 14:03 
AnswerRe: [Help] C# .txt Pin
Praveen Raghuvanshi18-Nov-12 18:30
professionalPraveen Raghuvanshi18-Nov-12 18:30 
GeneralRe: [Help] C# .txt Pin
mumbot18-Nov-12 19:43
mumbot18-Nov-12 19:43 
GeneralRe: [Help] C# .txt Pin
V.19-Nov-12 0:37
professionalV.19-Nov-12 0:37 
GeneralRe: [Help] C# .txt Pin
PIEBALDconsult23-Nov-12 9:46
mvePIEBALDconsult23-Nov-12 9:46 
AnswerRe: [Help] C# .txt Pin
omisheikh18-Nov-12 21:04
omisheikh18-Nov-12 21:04 
GeneralRe: [Help] C# .txt Pin
mumbot18-Nov-12 21:13
mumbot18-Nov-12 21:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.