May 2013
Intermediate to advanced
1152 pages
82h 34m
English
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 ...
Read now
Unlock full access