Solved

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

Posted on 2004-08-27
1
545 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Hide Tab Page 3 34
Red error squiggly on vb.net 7 27
I need help embedding Base64 Images using VB.Net - When image is a .jpg 2 42
Advice in Xamarin 21 57
Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
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…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

867 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now