Convert DataTable to Xml string variable...

  • Thread starter Thread starter Matthew Wells
  • Start date Start date
M

Matthew Wells

Hello,

I'm using C# behind an aspx file. I'm trying to find a way to convert a
datatable to xml and assign that to a string variable without saving to a
file. Obviously I don't want to slow down the process by writing to disk,
but all the methods I've found so far (datatable.writexml) write to a file.
I think there's a way to use a stream object, but I haven't come up with
anything. How can I get this done without writing to disk?

Thanks.

Matthew Wells
(e-mail address removed)
 
Hello Matthew,

Did you try to use StringWriter for your datatable.writexml ?

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo


MW> Hello,
MW>
MW> I'm using C# behind an aspx file. I'm trying to find a way to
MW> convert a datatable to xml and assign that to a string variable
MW> without saving to a file. Obviously I don't want to slow down the
MW> process by writing to disk, but all the methods I've found so far
MW> (datatable.writexml) write to a file. I think there's a way to use a
MW> stream object, but I haven't come up with anything. How can I get
MW> this done without writing to disk?
MW>
MW> Thanks.
MW>
MW> Matthew Wells
MW> (e-mail address removed)
 
Back
Top