Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2004-08-27
1
Medium Priority
?
589 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 500 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

670 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