Microsoft Certified Solutions Developer (MCSD) Certification Practice Test

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

Prepare for your Microsoft Certified Solutions Developer (MCSD) exam with flashcards and multiple choice questions. Each question includes hints and explanations to help you succeed. Get ready for your exam!

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.


What method is used to update data in a database using SQL commands?

  1. ExecuteReader

  2. ExecuteNonQuery-Async

  3. ExecuteScalar

  4. ExecuteQuery

The correct answer is: ExecuteNonQuery-Async

The method used to update data in a database using SQL commands is typically associated with the execution of SQL statements that do not return any result sets, such as INSERT, UPDATE, or DELETE commands. In this case, the appropriate choice is ExecuteNonQuery-Async. This method is specifically designed for executing SQL commands that affect the state of the database without returning rows. The "Async" part of the method name indicates that this operation can be performed asynchronously, which is beneficial for improving application responsiveness and performance by not blocking the main thread while waiting for the database operation to complete. This allows for better scalability when dealing with multiple database transactions or high-latency environments. The other methods mentioned serve different purposes. For example, ExecuteReader retrieves a data reader for reading a stream of rows from a database, while ExecuteScalar is used to retrieve a single value from a database, typically the result of an aggregate function. ExecuteQuery is not a standard method in the context of ADO.NET, as it doesn't directly represent a standard SQL command execution method for updating data.