O'Reilly logo

Windows® Phone 8 Unleashed by Daniel Vaughan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Restoring the Local Database

Restoring the local database involves submitting a background transfer request to download the previously uploaded file from the server. The file is downloaded to a temporary location in isolated storage, the existing local database is disconnected, and its file is replaced.

The RestoreDatabase method begins by creating a temporary directory where the downloaded .sdf file can be placed by the BackgroundTransferService:

const string downloadPath = transferDirectory + "/" + localDatabaseName;using (IsolatedStorageFile isolatedStorageFile            = IsolatedStorageFile.GetUserStoreForApplication()){    if (!isolatedStorageFile.DirectoryExists(transferDirectory))    {        isolatedStorageFile.CreateDirectory(transferDirectory); ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required