How do I read xml into a dataset?
Posted on 2004-03-27
I am programming an application for a pocket pc using .net framework 1.1 and pocketpc 2003.
I need to get a dataset from the computer (server) into the pocketpc, but I am having trouble serializing the xml dataset from the server to the handheld.
The code on my server loads a dataset with a single table, and then writes the xml to a socketstream.
BinaryWriter writer = new BinaryWriter(strm);
string ret = ds.GetXml();
On the pocket pc side, I am using a binary reader to read the incoming xml stream.
StringReader xmlSR = new System.IO.StringReader(args.Xml);
xmlTextReader reader = new XmlTextReader(xmlSR);
The result is, when I run this code, the args.Xml does contain XML data, but it is not getting read into the dataset. I pasted the xml from args.XML into xmlspy, but xml spy says it is not well formed xml. What is happening to the xml through the streaming? Or am I not loading the dataset correctly on the pocketpc side?
Thanks for your response.. I appreciate it very much. =]]