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.
Loading...
Related Quiz
- What is the purpose of the SqlDataReader class in ADO.NET?
- Which LINQ operator is commonly used to filter data in LINQ to Entities?
- Which ADO.NET data reader is used specifically for working with SQL Server databases?
- How can you improve the performance of Entity Framework queries when dealing with large datasets?
- Data binding can simplify UI development by automatically synchronizing ___________ and data source.