Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XmlDoc to stream

Status
Not open for further replies.

pdbowling

Programmer
Mar 28, 2003
267
US
Hi, everyone.

I wanted to feed an XmlDocument to a Stream object.
I am using Visual Studio 2005.


This compiled:

Code:
Stream newStream = null;
myXml.Save(stream);
but was very upset about newStream being null.
I tried to instantiate a 'new' stream but it didn't seem
to have a constructor as most objects seem to have.
Code:
Stream newStream = new Stream();

I'm not in love with this method by any means, so suggestions on getting the text into a stream would be welcome.

Maybe get the xml as a string or something.

Thanks everyone.
Pat

Gather or post content for free.
 
stream is abstract. you need to tell it what type of stream.
file, string, memory, byte, console...

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top