Click here to Skip to main content
15,885,782 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,
I have inserted in my project an xml file and want to have it's value, an integer, to be updated by 1, if the value is 1 to become 2 etc. how to read and write to xml file?
XML
<?xml version="1.0" encoding="utf-8" ?> 
<Person>
		<id>1</id>
  </Person>

the xml structure
VB
a=a+1

the vb update value
I don't want to keep a record just want to delete old value in xml and replace with new value
Posted
Comments
BulletVictim 5-Aug-14 4:14am    
Have you taken a look here

http://bytes.com/topic/visual-basic-net/answers/643043-change-existing-element-xml-file

http://bytes.com/topic/visual-basic-net/answers/374533-modify-value-into-xml-file

1 solution

You need a different concept.
The XML file is only a serialized version of an object, in your case an object of type Person with the id-Property of 1.
Now you need that Person class, with a function to create a Person object from an XML file, and a function to write its data back to an XML file.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900