What is Executescalar and Executenon query ?
Answers (1)
Add AnswerExecuteNonQuery:
This technique will only be used for insert, update, and delete, as well as Create and SET statements. The number of rows affected by INSERT, DELETE, or UPDATE actions will be returned by the ExecuteNonQuery method.
ExecuteScalar:
Single values can be retrieved from the database relatively quickly. On execution of a SQL Query or Stored Procedure using the command object, Execute Scalar will return a single row single column value.