PrepAway - Latest Free Exam Questions & Answers

You need to ensure that on synchronization, any new row added to the client application is also added to the S

You create a Microsoft Windows Mobilebased application by using the Microsoft .NET Framework 3.5 and Microsoft Synchronization Services for Microsoft ADO.NET.

The application uses a Microsoft SQL Server 2005 database. The application synchronizes the data in a large table named Products. The Products table is defined in the following manner.

The table has the following characteristics:

The default values are not defined for any column.
All the columns are non-nullable.
The ID and Price columns are synchronized.

You need to ensure that on synchronization, any new row added to the client application is also added to the SQL Server 2005 database.

Which code segment should you use?

PrepAway - Latest Free Exam Questions & Answers

A.
SyncAdapter adapter = new SyncAdapter(“Products”);
SqlCommand cmd = new SqlCommand(“UPDATE [Products] SET (Price=@Price, Visible=1) WHERE ID=@ID”);
adapter.UpdateCommand = (IDbCommand)cmd;

B.
SyncAdapter adapter = new SyncAdapter(“Products”);
SqlCommand cmd = new SqlCommand(“UPDATE [Products] SET (Price=@Price) WHERE ID=@ID”);
adapter.UpdateCommand = (IDbCommand)cmd;

C.
SyncAdapter adapter = new SyncAdapter(“Products”);
SqlCommand cmd = new SqlCommand(“INSERT INTO [Products] (ID, Price) ” + “VALUES (@ID, @Price)”);
adapter.InsertCommand = (IDbCommand)cmd;

D.
SyncAdapter adapter = new SyncAdapter(“Products”);
SqlCommand cmd = new SqlCommand(“INSERT INTO [Products] (ID, Price, Visible, UpdatedDate) ” + “VALUES (@ID, @Price, 0, GetDate())”);
adapter.InsertCommand = (IDbCommand)cmd;


Leave a Reply