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 6980299
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:59:53+00:00 2026-05-27T17:59:53+00:00

In the near future, I will be adding some features to my WP7 app.

  • 0

In the near future, I will be adding some features to my WP7 app. As seen here, I will be making some changes to the database. Where and how would you handle updates like this in the code? I don’t think there is a way to add code anywhere than runs on an ‘update’. It’s hardwired into the apps code.

I’m thinking of having a flag that gets set in IsolatedStorage. Name it something like v1.2UpgradeFlag, and set it to false. In the App.xaml.cs, check that flag, and if it is false, meaning the upgrade hasn’t run, run some set of code, and update the flag.

The idea of having code sitting there like that, that may not be applicable to multiple versions ago kind of clunky.

Edit: I’m also curious how I would manage cumulative updates to the application. So in v1.2, I have some code that updates the database schema. What if someone buys the app while it is at v1.3? I don’t want them ‘getting’ v1.1, having the app run 1.2 upgrade code, to get to v1.3.

  • 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-27T17:59:54+00:00Added an answer on May 27, 2026 at 5:59 pm

    Since this is the first time you will have to run a database upgrade, I would be tempted to add an extra table to the schema that will hold the version information. If, when you attempt to retrieve the data, it gives a NotFound error, you know you will need to run the upgrade. That way, you can manage the process in subsequent versions without having to manage the extra file.

    In order to do cumulative updates, you can use the same mechanism. You can maintain a method that will update the database from v1 to v1.2, another method to go from 1.2 to 1.3, etc. The method that maintains the upgrade process may look something like this pseudocode…

    var currentDbVersion = GetDbVersion();
    while(currentDbVersion < currentCodeVersion)
    {
        switch(currentDbVersion)
        {
            case 1.2:
                RunUpgradeFrom12to13();
                break;
            case 1.3:
                RunUpgradeFrom12to13();
                break;
            default:
                break;
        }
        currentDbVersion = GetDbVersion();
    }
    

    That should allow you to upgrade from any previous version to the current without maintaining several code paths (since a 1.0 to 1.2 upgrade will never change, and you should have a known start position for each cumulative step)

    There may well be far more sensible ideas out there, but this is the first thing I thought of.

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

Sidebar

Related Questions

In the near future i will get some 2 weeks for moving and improving
Some time in the near future I will need to implement a cross-language word
Some time in the near future, I will begin developing a game engine. One
In the near future, my organisation will have to change both the machine name
I wonder if RDBMS or OODBMS will be suppressed in near future? Today I
I have an OLD server running DG/UX that will in the near future be
In the very near future I'll be migrating some web applications from VS2003 projects
When Installing .NET Framework 4 in the near future, I would like to know
I've got some data that I'm parsing in Perl, and will be adding more
In the near future, I will be inheriting a somewhat large project. I've been

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.