Update XML with imported data
I'm exploring XML for the first time with VB.NET 2005 Express, and I'm having trouble with something.
The project is an Exchange Rate database, and the data I'm working with is the Country, Currency, Exchange Rate, From Date, To Date.
I'm reading in a Word document containing the required data, extracting relevant data from it, putting it into a DataSet, and presenting it in a DataGridView, and saving the content to an XML file.
This is fine.
What I then want to do is read in a different Word document, extract similar data, put it into the same DataGridView as the first 'import' (i.e. clear any existing content), and when I press Save, add the newly imported data to the first XML file (also saving any modifications the user has made in the DataGridView)
After this, I'll need to check the complete XML for duplicate entries and remove them (but I'll cross this bridge when I come to it).
here is an example, try like this
"Code to retrieve or save data in xml fiile
dim path as string = "C:\"
Dim ProfXML As New Xml.XmlDocument()
ProfXML.Load(path & "\File.xml")
'Root Element - Country
Dim Ref_Data As XmlElement = ProfXML.DocumentElement("Country")
'Currencyvalue, ExchangeValue, FromDAtevalue, Todatevalue - Value from datagrid
Ref_Data.Item("Curency").InnerText = currencyvalue
Ref_Data.Item("ExchangeRate").InnerText = Exchangeratevalue
Ref_Data.Item("FromDate").InnerText = FromDatevalue
Ref_Data.Item("ToDate").InnerText = Todatevalue
ProfXML.Save(path & "\file.xml")
By Cab_0001 in forum ASP.NET
Last Post: 01-18-2007, 08:33 PM
Last Post: 01-10-2003, 08:39 PM
By xmlstartkabel in forum XML
Last Post: 10-10-2001, 04:07 AM
By Rod Sanford in forum XML
Last Post: 10-02-2001, 10:54 AM
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL