PrepAway - Latest Free Exam Questions & Answers

You are required to provide code which returns a list of the orders and a list of the order_details.

DRAG DROP
There is MS Visual Studio 2010 and MS .NET Framework 4 application PassGuideApp.
PassGuideApp connects to a MS SQL Server database PassGuideDB.
To obtain data from PassGuideDB ADO.NET LINQ to SQL model is used.
PassGuideApp includes Order and Order_details entities.
You are required to provide code which returns a list of the orders and a list of the order_details.
This code must run one single SQL statement.
Which code can you use?

PrepAway - Latest Free Exam Questions & Answers

Answer:

Explanation:

2 Comments on “You are required to provide code which returns a list of the orders and a list of the order_details.

  1. John Galt says:

    Another seemingly incomplete question, though the specified answer does look correct.

    See the following link:
    http://msdn.microsoft.com/en-us/library/system.data.linq.dataloadoptions.loadwith%28v=vs.110%29.aspx

    Use the LoadWith method to specify which data related to your main target should be retrieved at the same time. For example, if you know you will need information about customers’ orders, you can use LoadWith to make sure the order information is retrieved at the same time as the customer information. This approach results in only one trip to the database for both sets of information.

    The example in the following link shows them using ‘DeferredLoadingEnabled = false’ as well:
    http://msdn.microsoft.com/en-us/library/bb386920%28v=vs.110%29.aspx




    0



    0

Leave a Reply