Chuck,
After you do the WriteXml to the Stream your stream will
be positioned at its end.
You have to move the Memory stream back to the beginning
by setting its Position property before you can write it
out. Try changing you code to the following.
public class FileListHelper : FileList
{
.....
public void SetData(DataSet data)
{
MemoryStream ms = new MemoryStream();
data.WriteXml(ms);
// Move the stream back to the beginning
ms.Position = 0;
this.ReadXml(ms);
}
.....
}
Took me hours of tearing my hair out to work out that
one. If your trying to do anything complex with Xml in a
DataSet there are quite a few problems to get around,
although when you get it working its really cool! I have
a couple of posts in this group with issues I have been
unable to resolve, if you sort any of them out be sure to
let me know. Hope this helps.
Regards,
David
|