exam questions

Exam 70-487 All Questions

View all questions & answers for the 70-487 exam

Exam 70-487 topic 3 question 7 discussion

Actual exam question from Microsoft's 70-487
Question #: 7
Topic #: 3
[All 70-487 Questions]

DRAG DROP -
The GetExternalOrders() method must use members of the EntityClient namespace to query the database for all records in the InboundQueue entity.
You need to modify the GetExternalOrders() method to return the correct data.
You have the following code:

Which code segments should you include in Target1, Target2, Target3 and Target4 to complete the code? To answer, drag the appropriate code segments to the correct targets in the answer area. Each code segment may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.
Each correct selection is worth one point.
NOTE:
Select and Place:

Show Suggested Answer Hide Answer
Suggested Answer:

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
SirRocko
Highly Voted 5 years, 1 month ago
The answear is correct
upvoted 5 times
Dreamchaser1980
4 years, 7 months ago
I also think the answer is correct, because the additional info that KeyInfo attribute returns is not used in the example code. SequentialAccess returns data column by column and hence could benefit the application by less memory usage, although not a lot of benefits because no large objects are returned by the database. ExternalOrdersEntities ExternalOrdersEntities -> see method DeleteExternalOrder ExecuteScalar SequentialAccess
upvoted 3 times
Dreamchaser1980
4 years, 7 months ago
I mean of course ExecuteReader instead of ExecuteScalar ExternalOrdersEntities ExternalOrdersEntities -> see method DeleteExternalOrder ExecuteReader SequentialAccess
upvoted 1 times
...
...
...
ozner16
Most Recent 4 years, 5 months ago
ExternalOrdersEntities -> see method ExecuteCommandProcedure ExternalOrdersEntities -> see method DeleteExternalOrder ExecuteReader -> We dont need ExecuteScalar as it only returns the value from the first column of the first row of your query. ExecuteReader() returns an object that can iterate over the entire result set (https://docs.microsoft.com/en-us/dotnet/api/system.data.sqlclient.sqlcommand?view=dotnet-plat-ext-5.0) SequentialAccess -> We dont need the extra information provided by the KeyInfo option (https://docs.microsoft.com/en-us/dotnet/api/system.data.commandbehavior?view=net-5.0)
upvoted 2 times
...
majco333
5 years, 1 month ago
ExternalOrdersEntities ExternalOrdersEntities -> see method DeleteExternalOrder ExecuteScalar KeyInfo
upvoted 1 times
majco333
5 years ago
Update: ExternalOrdersEntities ExternalOrdersEntities -> see method DeleteExternalOrder *ExecuteReader KeyInfo
upvoted 1 times
Supersevi
5 years ago
Not Agree with you, yes SecuentialAccess should be to retrieve images but we can use also here. KeyInfo retieves an extra data for key columns so I will go with SecuentialAccess.
upvoted 5 times
majco333
4 years, 12 months ago
Yes, I agree with you
upvoted 3 times
...
...
...
...
LeonWang
5 years, 3 months ago
I went for KeyInfo. SequentialAccess is used for reading large binary data as stream. Obviously there is no such data returned. When using KeyInfo, you will get the data and metadata with some added info for the primary key. https://social.msdn.microsoft.com/Forums/en-US/ab2109f1-dc0f-437e-9591-4ba2ff1ff15c/how-to-use-commandbehaviorschemaonlykeyinfo?forum=adodotnetdataproviders
upvoted 4 times
tiger25
5 years, 3 months ago
There is no other CommandBehavior options, so SequentialAccess is the only choice.
upvoted 4 times
Karel_Gott
5 years, 1 month ago
There is also KeyInfo option as LeonWang mentioned and his explanation makes sense for me. But I am not 100% certain what is correct. And how to choose correctly between ExternalOrders and ExternalOrdersEntities? I can't figure it out neither.
upvoted 1 times
...
ozner16
4 years, 5 months ago
there are other CommandBehavior options: https://docs.microsoft.com/en-us/dotnet/api/system.data.commandbehavior?view=net-5.0
upvoted 1 times
...
...
PrepX
4 years, 5 months ago
Agreed, KeyInfo just adds schema metadata to the regular column results and allows for accessing the reader using column names as indexes (see code example). SequentialAccess requires the columns to be processed using indexed methods like: GetString (int i) which is not in the supplied code! Therefore KeyInfo is the right CommandBehavior answer.
upvoted 2 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago