CertBus New Updated 70-516 Exam Dumps Free Download

How to pass 70-516 exam easily with less time? CertBus provides the most valid 70-516 exam preparation material to boost your success rate in Microsoft Windows Phone 7 70-516 TS: Accessing Data with Microsoft .NET Framework 4 exam. If you are one of the successful candidates with CertBus 70-516 PDF and VCEs, do not hesitate to share your reviews on our Microsoft Windows Phone 7 materials.

We CertBus has our own expert team. They selected and published the latest 70-516 preparation materials from Microsoft Official Exam-Center: http://www.certgod.com/70-516.html

QUESTION NO:18

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. The application connects to a Microsoft SQL Server database.

You use the ADO.NET Entity Framework to manage persistence-ignorant entities.

You create an ObjectContext instance named context. Then, you directly modify properties on several entities.

You need to save the modified entity values to the database.

Which code segment should you use?

A. context.SaveChanges(SaveOptions.AcceptAllChangesAfterSave);

B. context.SaveChanges(SaveOptions.DetectChangesBeforeSave);

C. context.SaveChanges(SaveOptions.None);

D. context.SaveChanges();

Correct Answer: B

Explanation

Explanation/Reference:

Explanation:

None Changes are saved without the DetectChanges or the AcceptAllChangesAfterSave() methods being called.

AcceptAllChangesAfterSave After changes are saved, the AcceptAllChangesAfterSave() method is called, which resets change tracking in the

ObjectStateManager. DetectChangesBeforeSave Before changes are saved, the DetectChanges method is called to synchronize the property values of objects

that are attached to the object context with data in the ObjectStateManager.

SaveOptions Enumeration

(http://msdn.microsoft.com/en-us/library/system.data.objects.saveoptions.aspx)


QUESTION NO:16

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. The application uses the ADO.NET Entity Framework to manage

customer and related order records.

You add a new order for an existing customer.

You need to associate the Order entity with the Customer entity.

What should you do?

A. Set the Value property of the EntityReference of the Order entity.

B. Call the Add method on the EntityCollection of the Order entity.

C. Use the AddObject method of the ObjectContext to add both Order and Customer entities.

D. Use the Attach method of the ObjectContext to add both Order and Customer entities.

Correct Answer: A

Explanation

Explanation/Reference:

Explanation:

Entity Reference (Of Entity) Represents a related end of an association with a multiplicity of zero or one.


QUESTION NO:11

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. The application connects to a Microsoft SQL Server database and

contains a LINQ to SQL data model. The data model contains a function named createCustomer that calls a stored procedure. The stored procedure is also

named createCustomer.

The createCustomer function has the following signature.

createCustomer (Guid customerID, String customerName, String address1)

The application contains the following code segment. (Line numbers are included for reference only.)

01 CustomDataContext context = new CustomDataContext();

02 Guid userID = Guid.NewGuid();

03 String address1 = “1 Main Steet”;

04 String name = “Marc”;

You need to use the createCustomer stored procedure to add a customer to the database.

Which code segment should you insert at line 05?

A. context.createCustomer(userID, name , address1)

B. context.ExecuteCommand(“createCustomer”, userID, name , address1);

C. Customer customer = new Customer() {ID = userID,Address1 = address1,Name = name,}; context.ExecuteCommand(“createCustomer”, customer);

D. Customer customer = new Customer() {ID = userID,Address1 = address1,Name = name, }; context.ExecuteQuery(typeof(Customer), “createCustomer”,

customer);

Correct Answer: A

Explanation

Explanation/Reference:

Explanation:

CHAPTER 4 LINQ to SQL

Lesson 3: Submitting Changes to the Database

Using Stored Procedures (page 285)


QUESTION NO:10

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to develop an application that connects to a Microsoft SQL Server 2008 database.

The application includes a SqlConnection named conn and a SqlCommand named cmd. You need to create a transaction so that database changes will be

reverted in the event that an exception is thrown.

Which code segment should you use?

A. var transaction = conn.BeginTransaction();cmd.Transaction = transaction;try{…

transaction.Commit();}catch{transaction.Rollback();}

B. var transaction = conn.BeginTransaction();cmd.Transaction = transaction;try{…

transaction.Commit();}catch{transaction.Dispose();}

C. var transaction = conn.BeginTransaction();cmd.Transaction = transaction;try{…}catch{transaction.Commit();}

D. var transaction = conn.BeginTransaction();cmd.Transaction = transaction;try{…

transaction.Rollback();}catch{transaction.Dispose ();}

Correct Answer: A

Explanation

Explanation/Reference:


QUESTION NO:5

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. The application connects to a Microsoft SQL Server database.

The application uses the ADO.NET Entity Framework to manage order data. The application makes a Web service call to obtain orders from an order-tracking

system.

You need to ensure that the orders are added to the local data store.

Which method should you call on the ObjectContext?

A. Attach

B. AttachTo

C. AddObject

D. ApplyCurrentValues

Correct Answer: C

Explanation

Explanation/Reference:

Explanation:

ObjectContext.AddObject() Call AddObject on the ObjectContext to add the object to the object context.

Do this when the object is a new object that does not yet exist in the data source. ObjectContext.Attach() Call Attach on the ObjectContext to attach the object to

the object context. Do this when the object already exists in the data source but is currently not attached to the context. If the object being attached has related

objects, those objects will also be attached to the object context. Objects are added to the object context in an unchanged state. The object that is passed to the

Attach method must have a valid EntityKey value. If the object does not have a valid EntityKey value, use the AttachTo method to specify the name of the entity

set.

ObjectContext.AttachTo() Call AttachTo on the ObjectContext to attach the object to a specific entity set in the object context or if the object has a null (Nothing in

Visual Basic) EntityKey value. The object being attached is not required to have an EntityKey associated with it. If the object does not have an entity key, then

entitySetName cannot be an empty string. ApplyCurrentValues() method is used to apply changes that were made to objects outside the ObjectContext,

such as detached objects that are received by a Web service. The method copies the scalar values from the supplied object into the object in the ObjectContext

that has the same key.

You can use the EntityKey of the detached object to retrieve an instance of this object from the data source.


QUESTION NO:9

You use Microsoft .NET Framework 4 to develop an application. The configuration file contains the following code segment.

<add name="AdventureWorksLT"

connectionString=”Data Source=SQL01;

Initial Catalog=AdventureWorksLT;

Integrated Security=True;”

providerName=”System.Data.SqlClient”/>

You need to retrieve the connection string named AdventureWorksLT from the configuration file.

Which line of code should you use?

A. var connectionString = ConfigurationManager

.ConnectionStrings[“AdventureWorksLT”].ConnectionString;

B. var connectionString = ConfigurationManager .ConnectionStrings[“AdventureWorksLT”].Name;

C. var connectionString = ConfigurationManager.AppSettings[“AdventureWorksLT”];

D. var connectionString = ConfigurationSettings.AppSettings[“AdventureWorksLT”];

Correct Answer: A

Explanation

Explanation/Reference:


QUESTION NO:3

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create a Windows Communication Foundation (WCF) Data Services service. The

service connects to a Microsoft SQL Server 2008 database. The service is hosted by an Internet Information Services (IIS) 6.0 Web server.

The application works correctly in the development environment. However, when you connect to the service on the production server, attempting to update or

delete an entity results in an error.

You need to ensure that you can update and delete entities on the production server.

What should you do?

A. Add the following line of code to the InitializeService method of the service.

config.SetEntitySetAccessRule (“*”,EntitySetRights.WriteDelete | EntitySetRights.WriteInsert);

B. Add the following line of code to the InitializeService method of the service.

config.SetEntitySetAccessRule (“*”,EntitySetRights.WriteDelete | EntitySetRights.WriteMerge);

C. Configure IIS to allow the PUT and DELETE verbs for the .svc Application Extension.

D. Configure IIS to allow the POST and DELETE verbs for the .svc Application Extension.

Correct Answer: C

Explanation

Explanation/Reference:

Explanation:

An OData client accesses data provided by an OData service using standard HTTP. The OData protocol largely follows the conventions defined by REST, which

define how HTTP verbs are used.

The most important of these verbs are:

GET: Reads data from one or more entities.

PUT: Updates an existing entity, replacing all of its properties. MERGE: Updates an existing entity, but replaces only specified properties[2].

POST: Creates a new entity.

DELETE: Removes an entity.

Http Header Verbs Enumeration

(http://msdn.microsoft.com/en-us/library/windows/desktop/aa364664(v=vs.85).aspx) WCF Data Services Overview

(http://msdn.microsoft.com/en-us/library/cc668794.aspx) Introduction to OData Protocol

(http://msdn.microsoft.com/en-us/data/hh237663)


QUESTION NO:19

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. The application connects to a Microsoft SQL Server database.

The application has two DataTable objects that reference the Customers and Orders tables in the database.

The application contains the following code segment. (Line numbers are included for reference only.)

01 DataSet customerOrders = new DataSet();

02 customerOrders.EnforceConstraints = true;

03 ForeignKeyConstraint ordersFK = new ForeignKeyConstraint(“ordersFK”,

04 customerOrders.Tables[“Customers”].Columns[“CustomerID”],

05 customerOrders.Tables[“Orders”].Columns[“CustomerID”]);

07 customerOrders.Tables[“Orders”].Constraints.Add(ordersFK);

You need to ensure that an exception is thrown when you attempt to delete Customer records that have related Order records.

Which code segment should you insert at line 06?

A. ordersFK.DeleteRule = Rule.SetDefault;

B. ordersFK.DeleteRule = Rule.None;

C. ordersFK.DeleteRule = Rule.SetNull;

D. ordersFK.DeleteRule = Rule.Cascade;

Correct Answer: B

Explanation

Explanation/Reference:

Explanation:

None No action taken on related rows, but exceptions are generated. Cascade Delete or update related rows. This is the default.

SetNull Set values in related rows to DBNull.

SetDefault Set values in related rows to the value contained in the DefaultValue property. SetDefault specifies that all child column values be set to the default

value.

CHAPTER 1 ADO.NET Disconnected Classes

Lesson 1: Working with the DataTable and DataSet Classes Cascading Deletes and Cascading Updates (page 26)


QUESTION NO:17

You use Microsoft .NET Framework 4 to develop an application that uses the Entity Framework.

The application has an entity model with a Person entity. A Person instance named person1 and an ObjectContext instance named model exist.

You need to delete the person1 instance. Which code segment should you use?

A. model.DeleteObject(person1);model.SaveChanges();

B. model.Detach(person1);model.SaveChanges();

C. model.ExecuteStoreCommand(“Delete”, new []{ new ObjectParameter(“Person”, person1) });model.SaveChanges();

D. model.ExecuteFunction(“Detach”, new []{ new ObjectParameter(“Person”, person1) });model.SaveChanges();

Correct Answer: A

Explanation

Explanation/Reference:

Explanation:

ObjectContext.DeleteObject Marks an object for deletion from the ObjectStateManager. The object is deleted in the data source when the SaveChanges method is

called. ObjectContext.ExecuteStoreCommand Method executes an arbitrary command directly against the data source using the existing connection.


QUESTION NO:20

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. The application connects to a Microsoft SQL Server 2008

database. The application uses DataContexts to query the database.

You create a function that meets the following requirements:

Updates the Customer table on the database when a customer is marked as deleted. Updates the related entries in other tables (CustomerAddress,

CustomerContacts) by marking them as deleted.

Prevents consumer code from setting the Deleted columns value directly. You need to ensure that the function verifies that customers have no outstanding orders

before they are marked as deleted.

You also need to ensure that existing applications can use the updated function without requiring changes in the code.

What should you do?

A. Override the Delete operation of the DataContext object.

B. Override the Update operation of the DataContext object.

C. Modify the SELECT SQL statement provided to the DataContext object to use an INNER JOIN between the Customer and Orders tables.

D. Add new entities to the DataContext object for the Customers and Orders tables.

Correct Answer: A

Explanation

Explanation/Reference:


CertBus exam braindumps are pass guaranteed. We guarantee your pass for the 70-516 exam successfully with our Microsoft materials. CertBus TS: Accessing Data with Microsoft .NET Framework 4 exam PDF and VCE are the latest and most accurate. We have the best Microsoft in our team to make sure CertBus TS: Accessing Data with Microsoft .NET Framework 4 exam questions and answers are the most valid. CertBus exam TS: Accessing Data with Microsoft .NET Framework 4 exam dumps will help you to be the Microsoft specialist, clear your 70-516 exam and get the final success.

70-516 Latest questions and answers on Google Drive(100% Free Download): https://drive.google.com/file/d/0B_3QX8HGRR1mWFJJcE5wbHYzak0/view?usp=sharing

70-516 Microsoft exam dumps (100% Pass Guaranteed) from CertBus: http://www.certgod.com/70-516.html [100% Exam Pass Guaranteed]

Why select/choose CertBus?

Millions of interested professionals can touch the destination of success in exams by certgod.com. products which would be available, affordable, updated and of really best quality to overcome the difficulties of any course outlines. Questions and Answers material is updated in highly outclass manner on regular basis and material is released periodically and is available in testing centers with whom we are maintaining our relationship to get latest material.

BrandCertbusTestkingPass4sureActualtestsOthers
Price$45.99$124.99$125.99$189$69.99-99.99
Up-to-Date Dumps
Free 365 Days Update
Real Questions
Printable PDF
Test Engine
One Time Purchase
Instant Download
Unlimited Install
100% Pass Guarantee
100% Money Back
Secure Payment
Privacy Protection