Forums Register Login
Saving XML document in DB
I am looking to save an XML document - really a DOM, not an actual file - in a SQL Server database. I've done lots of rummaging, and managed only to confuse myself (which doesn't take much). Any gentle, or not so gentle, nudges in the right direction would be greatly appreciated.

The closest I've been able to get is to convert the DOM to a string, and then write pass that thru a StringReader, and then finally insert it into the table, in an NText column, with .setCharacterStream. That gets some of the text from the DOM in, but not even close to all of it.

You need to save it as a Blob/Clob. Some databases like Oracle actually support XML as a datatype, although its really just a fancy Blob/Clob.
Nothing? Or something? Like this tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database

This thread has been viewed 922 times.

All times above are in ranch (not your local) time.
The current ranch time is
Jan 20, 2019 08:16:45.