Home » New Updated Microsoft MCTS 70-516 Real Exam Questions and Answers Download 151-160

New Updated Microsoft MCTS 70-516 Real Exam Questions and Answers Download 151-160

Ensurepass

QUESTION 151

You are working with an ObjectContext object that targets the mainframe and another ObjectContext object that targets SQL Server. When it’s time to save the changes, you want all changes to be sent to the mainframe and to SQL Server as one transaction.

How can you accomplish this?

 

  1. Just save both ObjectContext objects because they automatically join the same transaction.

  2. Save to the mainframe and use an if statement to verify that the changes were successful. If successful, save to SQL Server.

  3. Wrap the saving of both ObjectContext objects within a TransactionScope object that is implemented in a using statement in which the last line executes the Complete method on the TransactionScope class.

  4. Use a Boolean flag to indicate the success of each save, which will tell you whether the save was successful.

 

Correct Answer: C

 

 

QUESTION 152

The URI to your WCF data service is http://www.northwind.com/DataServices.svc. What can you add to the end of the URI to retrieve only a list of Order entities for the Customer entity whose CustomerID is `BONAP’?

 

  1. /Customers(`BONAP’)?$expand=Orders

  2. /Customers?$filter=CustomerID eq `BONAP’&$expand=Orders

  3. /Customers/Orders?$filter=CustomerID eq `BONAP’

  4. /Customers(`BONAP’)/Orders

 

Correct Answer: D

 

 

QUESTION 153

You are writing a WCF data service that will be included in a large project that has many other WCF data services. Your WCF data service will provide access to a SQL server using the Entity Framework. The EDMX file already exists in the project and is used by other services. One of the tables exposed by your service is the Contacts table, which contains the list of employees and the list of external contacts, which are denoted by the IsEmployee column that can be set to 1 or 0. You want to configure your WCF data service to return the external contacts whenever someone queries the Contacts entity set through WCF Data Services. What is the best way to solve this problem?

 

  1. Modify the Contacts entity set in the EDMX file.

  2. Add a stored procedure to SQL Server and modify the EDMX file to create a function import that you can call.

  3. Add a method to your WCF data service class and adorn the method with a QueryInterceptorAttribute of Contacts. In the method, provide the filter.

  4. Add a lazy loader to the WCF data service that will filter out the employees.

 

Correct Answer: C

 

 

QUESTION 154

What must you use to capture an exception that might occur when you are sending changes to the database server?

 

  1. A using block.

  2. A try/catch block.

  3. A while statement.

  4. You can’t capture exceptions.

 

Correct Answer: B

 

 

 

 

QUESTION 155

Which of the following are valid encryption algorithms that can be selected when encrypting the connection strings in your .config files? (Each correct answer presents a complete solution. Choose two.)

 

  1. DpapiProtectedConfigurationProvider

  2. RNGCryptoServiceProvider

  3. SHA256Managed

  4. RsaProtectedConfigurationProvider

  5. RijndaelManaged

 

Correct Answer: AD

 

 

QUESTION 156

Which of the following is a valid symmetric encryption algorithm?

 

  1. RNGCryptoServiceProvider

  2. RNGCryptoServiceProvider

  3. SHA256Managed

  4. RijndaelManaged

 

Correct Answer: D

 

 

QUESTION 157

You want to synchronize data between your local SQL Server Compact tables and SQL Server 2008. You want the synchronization to send changes to SQL Server 2008, and you want to receive changes from SQL Server 2008. Which setting must you assign to the SyncDirection property of your sync agent’s tables?

  1. SyncDirection.Bidirectional

  2. SyncDirection.UploadOnly

  3. SyncDirection.Snapshot

  4. SyncDirection.DownloadOnly

 

Correct Answer: A

 

 

QUESTION 158

You are adding a process to the application. The process performs the following actions:

 

1. Opens a ContosoEntities context object named context1.

2. Loads a Part object into a variable named part1.

3. Calls the Dispose() method on context1.

4. Updates the data in part1.

5. Updates the database by using a new ContosoEntities context object named context2.

You need to update the database with the changed data from part1. What should you do?

 

  1. Add the following code segment before calling SaveChanges() on context2:

context2.ApplyCurrentValues(“Parts”, part1);

 

  1. Add the following code segment before calling SaveChanges() on context2:

context2.Attach(part1);

context2.ApplyCurrentValues(“Parts”, part1);

 

  1. Add the following code segment befor
    e calling SaveChanges() on context2:

context2.Attach(part1);

context2.ObjectStateManager.ChangeObjectState(part1, System.Data.EntitySate.Modified);

 

  1. Add the following code segment before calling SaveChanges() on context2:

context2.ApplyOriginalValues(“Parts”, part1);

 

Correct Answer: C

 

 

QUESTION 159

The application must provide a component part list for any product. The component part list must give the quantity of each distinct part that is required to manufacture that product. You need to create a LINQ expression that delivers a result of type IEnumerable<Tuple<int,Part>> to meet the requirements. Which expression should you use?

 

  1. IEnumerable<Tuple<int, Part>> result = part.Children

.Distinct()

.GroupBy(p => p)

.Select(g => Tuple.Create(g.Count(), g.Key));

 

  1. IEnumerable<Tuple<int, Part>> result = part.Descendants

.GroupBy(p => p)

.Select(g => Tuple.Create(g.Count(), g.Key));

 

  1. IEnumerable<Tuple<int, Part>> result = part.Descendants

.ToDictionary(c => c)

.Select(d => Tuple.Create(d.Value.Children.Count(), d.Key));

 

  1. IEnumerable<Tuple<int, Part>> result = part.Children

.GroupBy(p => p)

.Select(g => Tuple.Create(g.Count(), g.Key));

 

  1. IEnumerable<Tuple<int, Part>> result = part.Descendants

.Distinct()

.GroupBy(p => p)

.Select(g => Tuple.Create(g.Count(), g.Key));

 

Correct Answer: B

 

 

QUESTION 160

You are developing a new feature that displays an auto-complete list to users as the type color names. You have an existing ContosoEntities context object named contex. To support the new feature you must develop code that will accept a string object named text containing a user’s partial input and will query the Colors database table to retrieve all color names that begin with that input. You need to create an Entity SQL (ESQL) query to meet the requirement. The query must not be vulnerable to a SQL injection attack. Which code segment should you use?

 

  1. var parameter = new ObjectParameter(“text”, text + “%”);

var result = context.CreateQuery<string>(

“SELECT VALUE (c.Name) FROM Colors AS c WHERE c.Name LIKE ‘@text'”, parameter);

 

  1. var parameter = new ObjectParameter(“text”, text + “%”);

var result = context.CreateQuery<string>(

“SELECT VALUE (c.Name) FROM Colors AS c WHERE c.Name LIKE @text”, parameter);

 

  1. var parameter = new ObjectParameter(“text”, text + “%”);

var result = context.CreateQuery<string>(

“SELECT (c.Name) FROM Colors AS c WHERE c.Name LIKE @text”, parameter);

 

  1. var parameter = new ObjectParameter(“text”, HttpUtility.HtmlEncode(text) + “%”);

var result = context.CreateQuery<string>(

“SELECT (c.Name) FROM Colors AS c WHERE c.Name LIKE ‘@text’@, parameter);

 

Correct Answer: B

 

Instant Access to Download Latest Complete Collection of Microsoft MCTS 70-516 Real Exam

Try Microsoft MCTS 70-516 Free Demo

HOT EXAM!
New Updated Microsoft MCTS 70-516 Real Exam Questions and Answers Download 161-170
New Updated Microsoft MCTS 70-516 Real Exam Questions and Answers Download 141-150

Name of author

Name: admin