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

Backing Up the Local Database

To transfer the local database to the server, it must first be copied to a directory in isolated storage. This prevents the file from being modified by the SQL CE engine while the transfer is under way. The viewmodel’s BackupDatabase method creates a temporary directory and then copies the local .sdf database file to the directory, as shown:

string uploadUrl = "http://localhost:60182/BackupService/UploadFile/";const string localDatabaseName = "Todo.sdf";const string transferDirectory = "/shared/transfers";string uploadPath = transferDirectory + "/" + localDatabaseName;using (IsolatedStorageFile isolatedStorageFile            = IsolatedStorageFile.GetUserStoreForApplication()){    if ...

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