exam questions

Exam 70-487 All Questions

View all questions & answers for the 70-487 exam

Exam 70-487 topic 1 question 71 discussion

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

HOTSPOT -
You are creating an application that retrieves Microsoft SQL Server data from two tables named Product and ProductModel.
You need to store in two separate lists all the names of the products and the product models for later use by the application.
How should you complete the code? To answer, select the appropriate options in the answer area.
Each correct selection is worth one point.
NOTE:
Hot Area:

Show Suggested Answer Hide Answer
Suggested Answer:
Box 1:
Two Select statements to get two results.
Box 2: (Reader.Read());
The SqlDataReader.Read Method advances the SqlDataReader to the next record. The default position of the SqlDataReader is before the first record. Therefore, you must call Read to begin accessing any data.

Return Value -

Type: System.Boolean -
true if there are more rows; otherwise false.
Box 3: Reader.NextResult();
The SqlDataReader.NextResult method advances the data reader to the next result, when reading the results of batch Transact-SQL statements. Used to process multiple results, which can be generated by executing batch Transact-SQL statements.
By default, the data reader is positioned on the first result.
Box 4: (Reader.Read());
References:
https://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqldatareader.nextresult(v=vs.110).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
Currently there are no comments in this discussion, be the first to comment!
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 ...