PrepAway - Latest Free Exam Questions & Answers

You need to ensure that when you delete a customer record, the corresponding order records are deleted…

You use Microsoft Visual Studio 2010 and the Microsoft NET Framework 4 to create an application
The application connects to a Microsoft SQL Sewer database The application uses DataContexts to
query the database You define a foreign key between me customers and orders tables in the
database You need to ensure that when you delete a customer record, the corresponding order

records are deleted You want to achieve this goal by using the minimum amount of development
effort. What should you do?

PrepAway - Latest Free Exam Questions & Answers

A.
Override the Delete operation of the customer entity.

B.
Remove the foreign key between the Customers and Orders tables.

C.
Use the Execute Dynamtic Delete method of the Data Context object.

D.
Modify the foreign key between the Customers and Orders tables to enable the ON
DELETE CASCADE option.

Explanation:
DataContext.ExecuteDynamicDelete Method
(http://msdn.microsoft.com/enus/library/system.data.linq.datacontext.executedynamicdelete.aspx)


Leave a Reply