-
Update XML with imported data
Hi,
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).
-
HI,
here is an example, try like this
'Xml Content
'Name: File.xml
<Country>
<Currency>Existingdata</Currency>
<ExchangeRate>Existingdata</ExchangeRate>
<FromDate>Existingdata</FromDate>
<ToDate>Existingdata</ToDate>
</Country>
"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")
Regards,
Nanda
Similar Threads
-
By Cab_0001 in forum ASP.NET
Replies: 7
Last Post: 01-18-2007, 09:33 PM
-
Replies: 5
Last Post: 01-10-2003, 09:39 PM
-
By xmlstartkabel in forum XML
Replies: 0
Last Post: 10-10-2001, 04:07 AM
-
By Rod Sanford in forum XML
Replies: 2
Last Post: 10-02-2001, 10:54 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|