473,385 Members | 1,907 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

WriteXML Error

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
Nov 19 '05 #1
0 1025

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: DraguVaso | last post by:
Hi, I should use XML to synchronize the data from different (VB.NET) applications, and I was just wondering which Overloads of these functions ( ReadXmlSchema, ReadXml and WriteXml) goes the...
2
by: Andreas Palm | last post by:
I have a dataset that has DBNull in certain columns, now when I write out this one to XML, I only get the columns as elements that do have data in it. However I do need also the empty colums as...
1
by: Greg R | last post by:
mydataset.WriteXml(strPath + "/my.xml"); produces this error [ArgumentException: URI formats are not supported. System.IO.Path.GetFullPathInternal(String path) +27...
1
by: Dave | last post by:
Hi all, I've seen that many people have had this exact same problem in the past, but no-one seems to post the answer when (if) they solve it... so here we go again. If I create a strongly...
3
by: Gordon Moore | last post by:
Hi, I'm new to using xml/xslt and although I can create an xml document using the dataset.WriteXml statement, and I have created an xslt to transform the xml into the output I want, I have to...
1
by: Jacky | last post by:
hello i have to know if the writeXML process is a blocking process. Other mean if i write doc.WriteXML(); int i = 0; Is i = 0 can be executed before doc.WriteXML() method ended???? All this...
4
by: Wes | last post by:
Hello, I have an application using an xml dataset to store app and user settings. The problem I am having is related to writexml. I have a save button on my application that updates the dataset...
3
by: ad | last post by:
I test the XmlWrite/XmlRead from MemoryStrem, my codes is: DataSet ds = Will.DM.ExecuteDataset("Select * from Customer); MemoryStream msOri = new MemoryStream(); ds.WriteXml(msOri); DataSet...
1
by: Luis Esteban Valencia | last post by:
Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source...
0
by: Arto Viitanen | last post by:
I am using WriteXML/ReadXml pair to save DataSet for later use. DataSet is built by reading textfiles and storing their data to different DataTables. Each file contains several complex values, that...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.