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

  • SEARCH
  • Home
  • 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 7517417
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T01:26:39+00:00 2026-05-30T01:26:39+00:00

I am creating a application in Windows Phone 7 Mango, and when I load

  • 0

I am creating a application in Windows Phone 7 Mango, and when I load up the application, the MainViewModel loads all the info from a file in isolated storage, with this function:

 private ObservableCollection<KasutajadViewModel> LoadUsers()
    {
        ObservableCollection<KasutajadViewModel> kasutajad = new ObservableCollection<KasutajadViewModel>();
        try
        {
            using (IsolatedStorageFile myIsolatedStorage = IsolatedStorageFile.GetUserStoreForApplication())
            {
                using (IsolatedStorageFileStream stream = myIsolatedStorage.OpenFile("Kasutajad.xml", FileMode.Open))
                {
                    XmlSerializer serializer = new XmlSerializer(typeof(ObservableCollection<PiletViewModel>));
                    //ObservableCollection<KasutajadViewModel> data
                    kasutajad =
                        (ObservableCollection<KasutajadViewModel>)serializer.Deserialize(stream);
                    stream.Close();
                }
            }
        }
        catch (Exception)
        {

        }
        return kasutajad;
    }

Problem is, that the deserializer doesn’t return the data.
Even when the XML file it reads from is like this:

<?xml version="1.0" encoding="utf-8"?>
<ArrayOfKasutajadViewModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"   xmlns:xsd="http://www.w3.org/2001/XMLSchema">
 <KasutajadViewModel>
    <Nimi>Reigo Hein</Nimi>
    <Isikukood>96952422597</Isikukood>
 </KasutajadViewModel>
</ArrayOfKasutajadViewModel>       

That is produced by a SaveUsers function, but I think this is redundant for the problem.
The LoadUsers loads the stream correctly, but the deserialization doesn’t output the required data.

Hope anyone can help me, thank you.

  • 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-05-30T01:26:40+00:00Added an answer on May 30, 2026 at 1:26 am

    You’re creating a XmlSerializer for an ObservableCollection of PiletViewModel, yet you’re deserializing an array of KasutajadViewModel. There’s a type inconsistency here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating windows application to insert data from Excel file into database. My
we are creating a windows Phone 7.5 application, this application is developed for specific
I am creating a windows application using VB.Net and this application will take a
I'm creating my first Windows Phone 7 application, and I'm struggling to find an
Taken from Exercise 1: Creating Windows Phone Applications with Microsoft Visual Studio 2010 Express
I am creating a Windows Application that capture the all users session details. I
I am creating a Windows Phone application and I have a problem with a
I am consuming WCF services from a Silverlight application (MVVM) and windows phone. I
I'm creating a Windows Phone 7 application that will consume an exposed webservice. For
We are creating sample application for windows mobile using Rijndael algorithm. Its working fine.

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.