Microsoft Certified Solutions Developer (MCSD) Certification Practice Test 2025 - Free MCSD Practice Questions and Study Guide

Question: 1 / 400

Which class is used to fill data from a database into a DataSet?

SqlCommand

DataAdapter

The correct choice is DataAdapter because it serves a crucial role in the process of filling a DataSet with data from a database. A DataAdapter acts as a bridge between a DataSet and the database, allowing for the retrieval (filling) as well as the updating of the database with changes made to the DataSet. Specifically, when using a DataAdapter, you call the Fill method, which populates the DataSet with data returned from the database based on a SQL query executed through an associated command.

Other classes mentioned, like SqlCommand and SqlDataReader, while they are vital for working with databases, serve different purposes. SqlCommand is primarily used to define and execute SQL queries against the database but does not directly fill a DataSet. SqlDataReader, on the other hand, provides a way to read a forward-only stream of data from the database but is also not responsible for filling a DataSet. DataRow is a class that represents a single row in a DataTable, which resides within a DataSet, but it does not handle the process of getting data from the database into the DataSet. Overall, the DataAdapter is specifically designed for this task, which is why it is the correct answer.

Get further explanation with Examzify DeepDiveBeta

SqlDataReader

DataRow

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy