Scenario: Your application allows users to update their profile information in a database. Which ADO.NET command is suitable for updating existing records?

  • SqlCommand.ExecuteNonQuery()
  • SqlCommand.ExecuteQuery()
  • SqlCommand.ExecuteScalar()
  • SqlCommand.ExecuteXmlReader()
SqlCommand.ExecuteNonQuery() is used to execute non-query commands, including data manipulation language (DML) queries like UPDATE statements. This command is ideal for tasks that modify the database without returning any data, making it suitable for updating existing records.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *