Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9052109
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T13:05:06+00:00 2026-06-16T13:05:06+00:00

hello friends i need some help about updating xml node in wp7. my xml

  • 0

hello friends i need some help about updating xml node in wp7. my xml is as follows :

<?xml version="1.0" encoding="utf-8"?>
<ConfigData>
  <CallerNo1>123</CallerNo1>
  <MobileNo1>123</MobileNo1>
  <MobileNo2>123</MobileNo2>
  <MobileNo3>123</MobileNo3>
  <MobileNo4>123</MobileNo4>
  <MobileNo5>123</MobileNo5>
  <EmailNo1>123</EmailNo1>
  <EmailNo2>123</EmailNo2>
  <EmailNo3>123</EmailNo3>
  <EmailNo4>123</EmailNo4>
  <EmailNo5>123</EmailNo5>
</ConfigData> 

i want to update value to 1111 so i wrote following code to achieve it :

using (IsolatedStorageFile myIsolatedStorage = IsolatedStorageFile.GetUserStoreForApplication())
                {
                    IsolatedStorageFileStream isoFileStream = myIsolatedStorage.OpenFile("Configuration.xml", FileMode.Open, FileAccess.ReadWrite);
                    XDocument xml = XDocument.Load(isoFileStream, LoadOptions.None);
                    xml.Element("ConfigData").SetElementValue("CallerNo1", "11111");
                    xml.Save(isoFileStream);
                    isoFileStream.Flush();
                    isoFileStream.Close();
                }

then after i read file again it shows xml like this :

<?xml version="1.0" encoding="utf-8"?>
<ConfigData>
  <CallerNo1>123</CallerNo1>
  <MobileNo1>123</MobileNo1>
  <MobileNo2>123</MobileNo2>
  <MobileNo3>123</MobileNo3>
  <MobileNo4>123</MobileNo4>
  <MobileNo5>123</MobileNo5>
  <EmailNo1>123</EmailNo1>
  <EmailNo2>123</EmailNo2>
  <EmailNo3>123</EmailNo3>
  <EmailNo4>123</EmailNo4>
  <EmailNo5>123</EmailNo5>
</ConfigData><?xml version="1.0" encoding="utf-8"?>
<ConfigData>
  <CallerNo1>11111</CallerNo1>
  <MobileNo1>123</MobileNo1>
  <MobileNo2>123</MobileNo2>
  <MobileNo3>123</MobileNo3>
  <MobileNo4>123</MobileNo4>
  <MobileNo5>123</MobileNo5>
  <EmailNo1>123</EmailNo1>
  <EmailNo2>123</EmailNo2>
  <EmailNo3>123</EmailNo3>
  <EmailNo4>123</EmailNo4>
  <EmailNo5>123</EmailNo5>
</ConfigData>

new xml is created and appended to existing xml what should be done to change the xml file ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T13:05:07+00:00Added an answer on June 16, 2026 at 1:05 pm

    This is because when you call Save(Stream) on the XmlDocument instance you are writing to the end of the isoFileStream you need to reset the position in the stream to write over what is already there.

    The easiest way to do this is to create a new IsolatedStorageFileStream for writing:

    using (IsolatedStorageFile myIsolatedStorage = IsolatedStorageFile.GetUserStoreForApplication())
    {
        XDocument xml = null;
        //Read the file stream into an XDocument using a reading stream
        using (IsolatedStorageFileStream isoFileStream = myIsolatedStorage.OpenFile("Configuration.xml", FileMode.Open, FileAccess.Read))
        {
            xml = XDocument.Load(isoFileStream, LoadOptions.None);
            xml.Element("ConfigData").SetElementValue("CallerNo1", "11111");
        }
    
        //Write it back out using a write one.
        using (IsolatedStorageFileStream isoFileStream = myIsolatedStorage.OpenFile("Configuration.xml", FileMode.Truncate, FileAccess.Write))
        {
            xml.Save(isoFileStream, SaveOptions.None);
        }
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello friends i need a book/ tutorials for rails without using scoffold. All the
I have a string $str = 'Hello my friends'; I need to put a
Hello friends i have created two page one is index.html and second is about.html
Hello friends i need to get user information from facebook i am using code
Hello freinds I need help as to how can I add 2 iFrames in
hello friends I need to download mp3 file from the internet and to store
hello friends , I need a publish my app in different-different market but not
Hello stack overflow I need help with this problem. Ok, I have a flat
Hello friends I have tried many times but I am not successful than please
hello friends i m new to jQuery and nyro modal. right now i m

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.