S
Steven Nagy
HI,
This all applies to a project in the compact framework (Pocket PC).
I need to convert a dataset object into XML which I will then send out
via TCP.
In a standard app I would do this as follows:
System.IO.StringWriter sw = new StringWriter();
ds.WriteXml(sw);
string xml = sw.ToString();
However the WriteXml method of compact datasets only supports filenames
and XMLWriters.
I DON'T want to write to a file and then read it in again; it would
kill have the devices resources to do so.
So I've been fumbling with the XMLWriter but can't get any XML out of
it. This is what I have in my device project:
TextWriter tw = new StringWriter();
XmlTextWriter xtw = new XmlTextWriter(tw);
ds.WriteXml(xtw, XmlWriteMode.WriteSchema);
// xtw.Flush();
tw.Write(xml);
Any help is greatly appeciated. I'm also going to need the REVERSE code
as well;
ie. From XML back to a DataSet. Schema needs to be included in both
directions.
Many thanks,
Steven Nagy
This all applies to a project in the compact framework (Pocket PC).
I need to convert a dataset object into XML which I will then send out
via TCP.
In a standard app I would do this as follows:
System.IO.StringWriter sw = new StringWriter();
ds.WriteXml(sw);
string xml = sw.ToString();
However the WriteXml method of compact datasets only supports filenames
and XMLWriters.
I DON'T want to write to a file and then read it in again; it would
kill have the devices resources to do so.
So I've been fumbling with the XMLWriter but can't get any XML out of
it. This is what I have in my device project:
TextWriter tw = new StringWriter();
XmlTextWriter xtw = new XmlTextWriter(tw);
ds.WriteXml(xtw, XmlWriteMode.WriteSchema);
// xtw.Flush();
tw.Write(xml);
Any help is greatly appeciated. I'm also going to need the REVERSE code
as well;
ie. From XML back to a DataSet. Schema needs to be included in both
directions.
Many thanks,
Steven Nagy