ExecuteNonQuery returns int

What values ExecuteNonQueryare returned if the update, insert, deleteare successful, at the same time, when they were unsuccessful?

+4
source share
4 answers

ExecuteNonQuery returns the number of rows affected.

ExecuteNonQuery

 For UPDATE, INSERT, and DELETE statements, the return value is the number of 
rows affected by the command.
+3
source

You can find suitable reference material, SqlCommand.ExecuteNonQueryMethod .

Quote directly:

Executes a Transact-SQL statement for the join and returns the number of rows affected.

So...

UPDATE, INSERT DELETE , . โ€‹โ€‹ , , , , . , -1. , -1.

, , (-) -1.

+2

ExecuteNonQuery

0

1.

0

Source: https://habr.com/ru/post/1525604/


All Articles