![]() |
|
[.NET] [VB.net] Datagridview <--> XML (read and write) - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [.NET] [VB.net] Datagridview <--> XML (read and write) (/showthread.php?tid=3907312) |
[VB.net] Datagridview <--> XML (read and write) - peacem4ker - Dec 4, 2013 Hi at all! I have a problem with writing form a datagridview into an XML file. Before that I read data from an XML a show the data in an DataGridView. This works correctly. If I add now some Data to the Datagridview and try to write the new data into the existing XML file. But unfortunately the Data is written into the wrong node. I read the data form the XML to the datagridview like that: Code DataSet As New DataSetI try to write data like that: Code DataSet.WriteXml(newXmlPath)My XML file looks like that: Code <?xml version="1.0"?>But if I add now a new row to the datagridview and try to save the new datagridview in the XML the XML file is saved like this: Code <?xml version="1.0"?>So my problem is now that the data will be added to another node not to the node I want to have the data. Which other possibility I have to write into the XML file keeping the old node strucuture? * - Only3 - Dec 4, 2013 Dim ds As New DataSet ds.ReadXml(xmlFile) DataGridView1.DataSource = ds.Tables(0) * - peacem4ker - Dec 4, 2013 (Dec 4, 2013 10:49 AM)Only3 Wrote: Dim ds As New DataSet Could you please be a little bit more precisely? I don't know what mean with these three lines of code * - Only3 - Dec 4, 2013 oo u want to write it with the changes ur problem is with writing to the xml file > adding node http://stackoverflow.com/questions/15616421/adding-data-to-a-node-of-an-xml-file-in-visual-basic then u can load it again |