Hi all,
I can't figure this out. I have code that references an XML file. Worked OK. Then I changed the XML file name and inserted a new XML named to the one referenced in the code. So, I would expect since now I am working with new XML data, BUT as named per the referenced file, I would see the new XML data in my app. But no, it still shows the old data! How is this possible?
In other words, somehow/somewhere, an instance of the data is being kept and used by VS.Net. However I have not added a file reference. Here is some code...
Dim xmlDoc As New XmlDocument
Dim product_list As XmlNodeList
Dim single_product As XmlNode
Dim this_path As String
this_path = "C:\Catalog\"
xmlDoc.Load(this_path & "products.xml")
product_list = xmlDoc.GetElementsByTagName("Product")
For Each single_product In product_list
Me.lstProducts.Items.Add(single_product.Attributes(1).InnerText)
Next
This code reads from products.xml and fills the list box (lstProducts) with a list of products - which come from the first attribute.
This all works. Let's say the first product is "ZZZ". Next I overwrite products.xml with another file named products.xml -- which has new xml data, and let's say the first product is "123". But when I run the app, the list box first entry is ZZZ!
The file containg ZZZ no longer exists! How can I fix this? What setting can I clear? I don't even get how this can be happening!
Thanks!
I can't figure this out. I have code that references an XML file. Worked OK. Then I changed the XML file name and inserted a new XML named to the one referenced in the code. So, I would expect since now I am working with new XML data, BUT as named per the referenced file, I would see the new XML data in my app. But no, it still shows the old data! How is this possible?
In other words, somehow/somewhere, an instance of the data is being kept and used by VS.Net. However I have not added a file reference. Here is some code...
Dim xmlDoc As New XmlDocument
Dim product_list As XmlNodeList
Dim single_product As XmlNode
Dim this_path As String
this_path = "C:\Catalog\"
xmlDoc.Load(this_path & "products.xml")
product_list = xmlDoc.GetElementsByTagName("Product")
For Each single_product In product_list
Me.lstProducts.Items.Add(single_product.Attributes(1).InnerText)
Next
This code reads from products.xml and fills the list box (lstProducts) with a list of products - which come from the first attribute.
This all works. Let's say the first product is "ZZZ". Next I overwrite products.xml with another file named products.xml -- which has new xml data, and let's say the first product is "123". But when I run the app, the list box first entry is ZZZ!
The file containg ZZZ no longer exists! How can I fix this? What setting can I clear? I don't even get how this can be happening!
Thanks!