Microsoft Certified Solutions Developer (MCSD) Certification Practice Test

Disable ads (and more) with a membership for a one time $2.99 payment

Prepare for the Microsoft Certified Solutions Developer Certification Test with multiple choice questions and flashcards. Each question comes with hints and explanations. Start mastering your skills now!

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


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

  1. SqlCommand

  2. DataAdapter

  3. SqlDataReader

  4. DataRow

The correct answer is: 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.