You use Microsoft Visual Studio 2010, Microsoft Sync Framework, and Microsoft .NET Framework 4.0 to create an application.
You have a ServerSyncProvider connected to a Microsoft SQL Server database. The database is hosted on a Web server.
Users will use the Internet to access the Customer database through the ServerSyncProvider.
You write the following code segment. (Line numbers are included for reference only.)
01 SyncTable customerSyncTable = new SyncTable(“Customer”);
02 customerSyncTable.CreationOption = TableCreationOption.UploadExistingOrCreateNewTable;
03 …
04 customerSyncTable.SyncGroup = customerSyncGroup;
05 this.Configuration.SyncTables.Add(customerSyncTable);
You need to ensure that the application meets the following requirements:
* Users can modify data locally and receive changes from the server.
* Only changed rows are transferred during synchronization.
Which code segment should you insert at line 03?
A.
customerSyncTable.SyncDirection = SyncDirection.DownloadOnly;
B.
customerSyncTable.SyncDirection = SyncDirection.Snapshot;
C.
customerSyncTable.SyncDirection = SyncDirection.Bidirectional;
D.
customerSyncTable.SyncDirection = SyncDirection.UploadOnly;
Explanation:
TableCreationOption:
CreateNewTableOrFail – Create the table in the client database. If an existing table has the same name, throw an exception.
DropExistingOrCreateNewTable – Create the table in the client database. If an existing table has the same name, drop the existing table first.
TruncateExistingOrCreateNewTable – Create the table in the client database if the table does not exist. If an existing table has the same name, delete all rows from this table.
UploadExistingOrCreateNewTable – Create the table in the client database if the table does not exist. If an existing table has the same name, upload all rows from this table on the first synchronization.
This option is only valid with a SyncDirection of Bidirectional or UploadOnly.
UseExistingTableOrFail – Use an existing table in the client database that has the same name. If the table does not exist, throw an exception.SyncDirection:
Bidirectional – During the first synchronization, the client typically downloads schema and an initial data set from the server.
On subsequent synchronizations, the client uploads changes to the server and then downloads changes from the server.
DownloadOnly – During the first synchronization, the client typically downloads schema and an initial data set from the server.
On subsequent synchronizations, the client downloads changes from the server.
Snapshot – The client downloads a set of data from the server. The data is completely refreshed during each synchronization.
UploadOnly – During the first synchronization, the client typically downloads schema from the server.
On subsequent synchronizations, the client uploads changes to the server.TableCreationOption Enumeration
(http://msdn.microsoft.com/en-us/library/microsoft.synchronization.data.tablecreationoption.aspx)SyncDirection Enumeration
(http://msdn.microsoft.com/en-us/library/microsoft.synchronization.data.syncdirection.aspx)CHAPTER 8 Developing Reliable Applications
Lesson 4: Synchronizing Data
Implementing the Microsoft Sync Framework (page 566)