Saving a XML document to memory

  • Thread starter Thread starter C#Schroeder
  • Start date Start date
C

C#Schroeder

I am creating an XML document on my C drive using the
XMLSerialization. I need to save the XML document into memory rather
then onto my C drive. What is the best way for me to do this? Thanks
in advance for your help
 
Stick it in a Generic List or Dictionary, or a Hashtable, or even an
ArrayList. Choice is yours depending on what qualities you need
programmatically.
If you don't need an object, you could even store it in the AppDomain Cache
with:
AppDomain.CurrentDomain.SetData("mydoc1", theXmlDocumentObject);

and get it back with

XmlDocument myDoc = (XmlDocument)AppDomain.CurrentDomain.GetData("mydoc1");

Peter
 
Back
Top