What should you do to ensure that only 10 new records are downloaded?

You create a Microsoft Windows Mobilebased application by using the Microsoft .NET Framework 3.5 and Microsoft ADO.NET. The application connects to a Microsoft SQL Server 2005 database.

The application caches data from the database server.
You write the following code segment. (Line numbers are included for reference only.)

01 public class MySyncProvider : DbServerSyncProvider{
02 public MySyncProvider (){
03 SqlConnection serverConn = new SqlConnection("SERVER = .; Database = pubs; uid = sa;");
04 this.Connection = serverConn;
05
06 this.BatchSize = 10;
07 }
08
09 }

You need to ensure that only 10 new records are downloaded whenever the application synchronizes.

What should you do?

You create a Microsoft Windows Mobilebased application by using the Microsoft .NET Framework 3.5 and Microsoft ADO.NET. The application connects to a Microsoft SQL Server 2005 database.

The application caches data from the database server.
You write the following code segment. (Line numbers are included for reference only.)

01 public class MySyncProvider : DbServerSyncProvider{
02 public MySyncProvider (){
03 SqlConnection serverConn = new SqlConnection(“SERVER = .; Database = pubs; uid = sa;”);
04 this.Connection = serverConn;
05
06 this.BatchSize = 10;
07 }
08
09 }

You need to ensure that only 10 new records are downloaded whenever the application synchronizes.

What should you do?

A.
Insert the following line of code at line 05.
this.Schema.SchemaDataSet.EnforceConstraints = true;

B.
Insert the following line of code at line 05.
this.SelectClientIdCommand = new SqlCommand(sqlQuery, this.Connection);

C.
Insert the following line of code at line 05.
this.SelectNewAnchorCommand = new SqlCommand(sqlQuery, this.Connection);

D.
Insert the following line of code at line 05.
this.SelectingChanges += new ?EventHandler<SelectingChangesEventArgs>(MySyncProvider_SelectingChanges);
Insert the following code segment at line 08.
void MySyncProvider_SelectingChanges(object sender, SelectingChangesEventArgs e)
{
Context.MaxAnchor = new SyncAnchor();
}



Leave a Reply 1

Your email address will not be published. Required fields are marked *


Google

Google

Always a big fan of linking to bloggers that I love but really don’t get a lot of link enjoy from.