Mr_Ezi
asked on
DataSet.WriteXml(FileName.xml) aborts, and no exception is thrown
Hi,
I am reading data from several database tables into a dataset and writing it to xml file using DataSet.WriteXML() method - overall the file size could be 7-10mb. For the most part this works fine, however, on few occasions it has been noticed that only partial data is written to xml, or letter's are missing from tags (like: <TransID>1001</T ansID>).
No exception is thrown - the error is realized only when next time the file is read.
I would also like to know whether,
1) DataSet.WriteXML() has limitation in terms of the file size? and, can we somehow verify whether the data written by WriteXML() is complete?
2) Is there any other safer way to write the data from the database to xml file?
Thanks in advance,
I am reading data from several database tables into a dataset and writing it to xml file using DataSet.WriteXML() method - overall the file size could be 7-10mb. For the most part this works fine, however, on few occasions it has been noticed that only partial data is written to xml, or letter's are missing from tags (like: <TransID>1001</T ansID>).
No exception is thrown - the error is realized only when next time the file is read.
I would also like to know whether,
1) DataSet.WriteXML() has limitation in terms of the file size? and, can we somehow verify whether the data written by WriteXML() is complete?
2) Is there any other safer way to write the data from the database to xml file?
Thanks in advance,
ASKER
Thanks for this tip, but it doesn't solve the problem, because I need to write the changes from the application's dataset back into the xml file.
If there is a way to write back just the data I changed that will help a lot!
But I don't think there is one...
If there is a way to write back just the data I changed that will help a lot!
But I don't think there is one...
Have you tried DataSet.WriteXML(filename, , XmlWriteMode.DiffGram) ???
Dabas
Dabas
ASKER
No I didn't, what will that help?
oops. Remove extra comma
It is a way to find out only the data that has changed.
You did say that will help a lot
Dabas
You did say that will help a lot
Dabas
ASKER
Oh Let's try it, Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
No it's not a multi-threaded application.
Thanks for your tip.
But I want to try first the XmlWriteMode.DiffGram because the problem ONLY happens when I write big files, so if I'll be able to write just the changes then I'm fine.
But I'm not sure how this works
Thanks for your tip.
But I want to try first the XmlWriteMode.DiffGram because the problem ONLY happens when I write big files, so if I'll be able to write just the changes then I'm fine.
But I'm not sure how this works
Did you do a Check Disk operation on your disk to see if you had any issues?
http://www.ehow.com/how_4967757_run-chkdsk-utility-vista.html
http://www.ehow.com/how_4967757_run-chkdsk-utility-vista.html
ASKER
No I'm sure its not a hard drive problem.
I have it on a few different computers
I have it on a few different computers
ASKER
Ok I found a way to write just the new data, the problem is that it writes the <MainDataSet> and </MainDataSet> tags again, How can I get rid of it?
Dim ChangedDS As DataSet = ds.GetChanges()
fs = New FileStream(SDCardPath + "\" + CustomerID + ".xml", IO.FileMode.Append)
ChangedDS.WriteXml(fs)
Dim ChangedDS As DataSet = ds.GetChanges()
fs = New FileStream(SDCardPath + "\" + CustomerID + ".xml", IO.FileMode.Append)
ChangedDS.WriteXml(fs)
ASKER
Thanks, I had to figure out the stuff my self, but your tip to use a stream helped a lot...
http://articles.sitepoint.com/article/data-as-xml-sql-server