exam questions

Exam 70-487 All Questions

View all questions & answers for the 70-487 exam

Exam 70-487 topic 3 question 3 discussion

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

You need to modify the ExecuteCommandProcedure() method to meet the technical requirements.
Which code segment should you use?

  • A. Option A
  • B. Option B
  • C. Option C
  • D. Option D
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️
Synchronous to Asynchronous Connection Open
You can upgrade an existing application to use the new asynchronous feature. For example, assume an application has a synchronous connection algorithm and blocks the UI thread every time it connects to the database and, once connected, the application calls a stored procedure that signals other users of the one who just signed in.
When converted to use the new asynchronous functionality, the program would look like: await conn.OpenAsync(); await cmd.ExecuteNonQueryAsync();
References:
https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/asynchronous-programming

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
Supersevi
Highly Voted 5 years, 1 month ago
Only posibility es A, answer is correct. The rest options are not correct.
upvoted 10 times
mr_
4 years, 10 months ago
Yep, exactly, I agree. * Not B: missing async keyword which is mandatory in order to make method asynchronous. * Not C: missing async keyword which is mandatory in order to make method asynchronous. * Not D: async keyword in place, but missing await keyword in the async method scope - meaning even though there is async keyword, the method will run synchronously. Correct is A: Both async and await-s are in place.
upvoted 4 times
...
...
C0unt23r0
Most Recent 5 years, 4 months ago
https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/asynchronous-programming?view=netframework-4.8
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 ...