XML

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to store some data in a field in a database as XML - is there any
classes in .NET that allow me to pass data and tags to build up a string of
XML?
 
Tony,

Check out the classes in the System.Xml namespace, specifically the
XmlWriter and the XmlTextWriter classes, as they will help you construct XML
output, which you can then store to a string, which can then be placed in a
database.

Hope this helps.
 
How do these classes cope with me creating tags that clash with the data -
for instance is there a problem if I create code

<abc>abc</abc>

Thanks



Nicholas Paldino said:
Tony,

Check out the classes in the System.Xml namespace, specifically the
XmlWriter and the XmlTextWriter classes, as they will help you construct XML
output, which you can then store to a string, which can then be placed in a
database.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Tony said:
I want to store some data in a field in a database as XML - is there any
classes in .NET that allow me to pass data and tags to build up a string
of
XML?
 
Tony,

I don't understand what you mean. The example that you gave:

<abc>abc</abc>

Doesn't conflict with the data at all. It's just that the text in the
tag happens to be the same as the name of the tag. Any XML parser/generator
worth it's salt isn't going to get hung up on that. The
XmlWriter/XmlTextWriter certainly doesn't.

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Tony said:
How do these classes cope with me creating tags that clash with the data -
for instance is there a problem if I create code

<abc>abc</abc>

Thanks



Nicholas Paldino said:
Tony,

Check out the classes in the System.Xml namespace, specifically the
XmlWriter and the XmlTextWriter classes, as they will help you construct
XML
output, which you can then store to a string, which can then be placed in
a
database.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Tony said:
I want to store some data in a field in a database as XML - is there any
classes in .NET that allow me to pass data and tags to build up a
string
of
XML?
 
Back
Top