Solved

How to Read/Write to XML file in .Net Compact Framework Using VB.Net

Posted on 2004-08-27
1
578 Views
Last Modified: 2008-01-09
This is the structure of my file:
<?xml version="1.0" encoding="utf-8"?>
<Configuration>
  <ZipCode>11787</ZipCode>
  <RefreshRate>5000</RefreshRate>
</Configuration>

On my form I have two text boxes one for the zip code and the other for the refresh rate. What I would like to do is when the application loads the two text boxes are populated with the data from the xml file. I then have a Save button below the two text boxes. What I would like to do here is save the changes I made in the text boxes to the same xml file.

I am trying to create a Pocket PC application and this xml file is being used as a configuration file.

Thanks In Advance.
0
Comment
Question by:AccessYourBiz_Com
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 5

Accepted Solution

by:
thenrich earned 125 total points
ID: 11916845

 Dim xmlDoc As New Xml.XmlDataDocument
   xmlDoc.Load(Application.StartupPath & "\temp.xml")
   xmlDoc.GetElementsByTagName("ZipCode")(0).InnerXml = textbox.text
   xmlDoc.GetElementsByTagName("ZipCode")(0).InnerXml = RefreshRate
   xmlDoc.Save(Application.StartupPath & "\test.xml")
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

622 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question