exam questions

Exam 70-483 All Questions

View all questions & answers for the 70-483 exam

Exam 70-483 topic 1 question 3 discussion

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

You are developing an application that includes the following code segment. (Line numbers are included for reference only.)

The GetAnimals() method must meet the following requirements:
✑ Connect to a Microsoft SQL Server database.
✑ Create Animal objects and populate them with data from the database.
✑ Return a sequence of populated Animal objects.
You need to meet the requirements.
Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

  • A. Insert the following code segment at line 16: while(sqlDataReader.NextResult())
  • B. Insert the following code segment at line 13: sqlConnection.Open();
  • C. Insert the following code segment at line 13: sqlConnection.BeginTransaction();
  • D. Insert the following code segment at line 16: while(sqlDataReader.Read())
  • E. Insert the following code segment at line 16: while(sqlDataReader.GetValues())
Show Suggested Answer Hide Answer
Suggested Answer: BD 🗳️
✑ SqlConnection.Open - Opens a database connection with the property settings specified by the ConnectionString.
✑ SqlDataReader.Read - Advances the SqlDataReader to the next record.
References:
http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.open.aspx http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqldatareader.read.aspx

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
Diogo
Highly Voted 5 years, 7 months ago
... and switch "return customers" for "return animals"
upvoted 10 times
...
apostolin
Highly Voted 5 years, 9 months ago
Correct answers are : B.D.
upvoted 6 times
...
EnthusiastGuy
Most Recent 4 months ago
Selected Answer: AD
Anyone bothered that we're returning "customers" (which is not even declared anywhere I can see) instead of "animals"?
upvoted 1 times
...
zzMichielzz
4 years, 8 months ago
B,D. Connection must be open and Read
upvoted 3 times
...
cshine
4 years, 9 months ago
B & D are correct
upvoted 2 times
...
lh2607
4 years, 11 months ago
B, D are correct
upvoted 2 times
...
XardasLord
5 years ago
B and D
upvoted 2 times
...
robinnirola
5 years, 1 month ago
Ans : B , D
upvoted 2 times
...
tanujgyan
5 years, 2 months ago
Correct ANswers: B and D
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 ...