C
Chuck Haeberle
We're using the Microsoft Application Blocks SQL Helper in our projects,
which is a great time saver but doesn't support use of Strongly Typed
DataSets.
I'm trying to find an easy way to take a generic dataset which has been
populated and transfer its data into my strongly typed data set.
Assume an XSD called FileList. I use a derived class based on the XSD since
changing the XSD regenerates its base code...
public class FileListHelper : FileList
{
....
public void SetData(DataSet data)
{
MemoryStream ms = new MemoryStream();
data.WriteXml(ms);
this.ReadXml(ms);
}
}
Now reading the overloads for ReadXML this should work, but instead I get an
error that the Root Node doesnt' exist on the ReadXML.
Any advice? Or alternate approches for taking a DataSet and moving its data
into an XSD or XSD Derivative?
which is a great time saver but doesn't support use of Strongly Typed
DataSets.
I'm trying to find an easy way to take a generic dataset which has been
populated and transfer its data into my strongly typed data set.
Assume an XSD called FileList. I use a derived class based on the XSD since
changing the XSD regenerates its base code...
public class FileListHelper : FileList
{
....
public void SetData(DataSet data)
{
MemoryStream ms = new MemoryStream();
data.WriteXml(ms);
this.ReadXml(ms);
}
}
Now reading the overloads for ReadXML this should work, but instead I get an
error that the Root Node doesnt' exist on the ReadXML.
Any advice? Or alternate approches for taking a DataSet and moving its data
into an XSD or XSD Derivative?