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.
ExecuteNonQuery returns 0
-
- Devart Team
- Posts: 2420
- Joined: Wed 02 Nov 2011 09:44
Re: ExecuteNonQuery returns 0
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.
The number of matched rows is not returning by MySqlCommand.