exam questions

Exam 70-483 All Questions

View all questions & answers for the 70-483 exam

Exam 70-483 topic 1 question 49 discussion

Actual exam question from Microsoft's 70-483
Question #: 49
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 GetCustomers() method must meet the following requirements:
✑ Connect to a Microsoft SQL Server database.
✑ Populate Customer objects with data from the database.
✑ Return an IEnumerable<Customer> collection that contains the populated Customer 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 17: while (sqlDataReader.GetValues())
  • B. Insert the following code segment at line 14: sqlConnection.Open();
  • C. Insert the following code segment at line 14: sqlConnection.BeginTransaction();
  • D. Insert the following code segment at line 17: while (sqlDataReader.Read())
  • E. Insert the following code segment at line 17: while (sqlDataReader.NextResult())
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
mmarinov
Highly Voted 5 years, 2 months ago
The provided answers are correct. B) D)
upvoted 9 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 ...