exam questions

Exam 70-483 All Questions

View all questions & answers for the 70-483 exam

Exam 70-483 topic 2 question 19 discussion

Actual exam question from Microsoft's 70-483
Question #: 19
Topic #: 2
[All 70-483 Questions]

DRAG DROP -
You are creating a method that saves information to a database.
You have a static class named LogHelper. LogHelper has a method named Log to log the exception.
You need to use the LogHelper Log method to log the exception raised by the database server. The solution must ensure that the exception can be caught by the calling method, while preserving the original stack trace.
How should you write the catch block? (Develop the solution by selecting and ordering the required code snippets. You may not need all of the code snippets.)
Select and Place:

Show Suggested Answer Hide Answer
Suggested Answer:
Note:
Catch the database exception, log it, and then rethrow it.
* SQLException
An exception that provides information on a database access error or other errors.

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
DaGrooveNL
4 years, 3 months ago
FINAL ANSWER: 2. catch (SqlException ex) { 8. LogHelper.Log(ex); 4. throw; 5. }
upvoted 3 times
...
noussa
4 years, 3 months ago
The original answer is correct. 2, 8,4,5
upvoted 3 times
...
supersunny
5 years, 9 months ago
The slabs to implement are in 1, 8, 4,5 order.
upvoted 1 times
asdf652434
5 years, 7 months ago
it should be 2, 8, 4, 5 catch (SqlException ex) { LogHelper.Log(ex); throw; }
upvoted 26 times
founderDev
5 years, 2 months ago
""exception raised by the database server"". your answer is correct
upvoted 7 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