K
Kenneth Keeley
Hi,
I am reading in an xml file into a dataset that I then make changes to
before trying to save the updates to file. When I do I get the following
error:
Token StartElement in state Epilog would result in an invalid XML document
This is a sample of my update code:
{
DataRow dr;
DataView dv = new DataView(myDataSet.Tables[1]);
dv.RowFilter = "guid='" + MyGuidID + "'";
if (dv.Count > 0)
{
dv.Delete(0);
}
dv.RowFilter = "";
// Add the new entry.
dr = myDataSet.Tables[1].NewRow();
dr[0] = MyGuidID;
dr[1] = "Sample Text";
myDataSet.Tables[1].Rows.Add(dr);
myDataSet.WriteXml("c:\\Addrbook2.XML");
}
This is a sample of the incoming XML file.
<?xml version="1.0"?>
<addressBook version="8.0">
<contact>
<fullName><![CDATA[First name Inital Last name]]></fullName>
<email><![CDATA[E-mail Address]]></email>
</contact>
</addressBook>
If I manually remove the version="8.0" from the addressBook entry then the
system works.
Can somebody Help me.
Kenneth
I am reading in an xml file into a dataset that I then make changes to
before trying to save the updates to file. When I do I get the following
error:
Token StartElement in state Epilog would result in an invalid XML document
This is a sample of my update code:
{
DataRow dr;
DataView dv = new DataView(myDataSet.Tables[1]);
dv.RowFilter = "guid='" + MyGuidID + "'";
if (dv.Count > 0)
{
dv.Delete(0);
}
dv.RowFilter = "";
// Add the new entry.
dr = myDataSet.Tables[1].NewRow();
dr[0] = MyGuidID;
dr[1] = "Sample Text";
myDataSet.Tables[1].Rows.Add(dr);
myDataSet.WriteXml("c:\\Addrbook2.XML");
}
This is a sample of the incoming XML file.
<?xml version="1.0"?>
<addressBook version="8.0">
<contact>
<fullName><![CDATA[First name Inital Last name]]></fullName>
<email><![CDATA[E-mail Address]]></email>
</contact>
</addressBook>
If I manually remove the version="8.0" from the addressBook entry then the
system works.
Can somebody Help me.
Kenneth