Hour 7

Quiz Answers

1: What is the purpose of the ExecuteNonQuery() method of the Command object?
A1: The ExecuteNonQuery() object is used to execute commands against the data source that will not return any records. Therefore, it is ideal to use in situations where you want to modify or delete database data.
2: True or false: Using the ExecuteNonQuery() method to execute a query that returns data will result in an exception error being thrown from the data layer.
A2: False. If you execute a query using ExecuteNonQuery() that will return data, it will result in the data from your database query being lost, but no error will occur.

Get Sams Teach Yourself ADO.NET in 24 Hours now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.