Working with DML

Working with DML (Insert, Update, Select, Delete)

Usually, Insert, update and delete are used to write or change data in the database, while Select is used to read data.
For this reason, we have different types of methods to execute those queries.
The methods are the following:

ExecuteNonQuery: Used to execute a command that will not return any data, for example Insert, update or delete.
ExecuteReader: Used to execute a command that will return 0 or more records, for example Select.
ExecuteScalar: Used to execute a command that will return only 1 value, for example Select Count(*).