Page 1 of 1

ExecuteNonQuery returns 0

Posted: Tue 27 Jun 2017 15:57
by alejandro_aries
Hello.
In our software company, we bought mysql devart connector to replace the mysql.data original connector for our software application which creates large transactions through {Devart.Data.MySql.MySqlCommand} sending 'updates' and 'insert' commands. Mysql.Data connector returns 1 if there is 1 row matched even if it there are 0 rows changed.
On the other hand, Devart.Data.Mysql connector returns 0 if there are 0 rows changed even if there is 1 row matched as the image attached below.

I cannot change the source code of my software application, and I would like to know how to retrieve the rows matched and the rows changed according to the Devart.Data.MySql.MysqlCommand class, but I havenĀ“t been able to achieve it due protection level.
How do you think I could do that ?

Thank you very much.

Image

Re: ExecuteNonQuery returns 0

Posted: Fri 30 Jun 2017 15:48
by Pinturiccio
The ExecuteNonQuery method of MySqlCommand class returns the number of affected records for UPDATE, INSERT, and DELETE statements. For all other types of statements, including stored procedures, the return value is '-1'. For more information, please refer to https://www.devart.com/dotconnect/mysql ... Query.html

The number of matched rows is not returning by MySqlCommand.