SYMPTOMS
When you are using smartDBforms.NET with MySQL and when you edit an existing database record and try
to update it without changing anything in the fields then you receive 'No data was affected' error.
CAUSE
MySQL ODBC driver reports the number of affected records only if an actual change
has been made. In this case there was no change in the data and MySQL ODBC driver
reports affected records as 0. OperationStatus ASP.NET control considers 0 affected
rows as a potential problems and reports the problem.
RESOLUTION
You can resolve the problem either by changing the behaviour of the ODBC driver
or changing the behaviour of the OperationStatus.
To change the behaviour of ODBC when configuring the database connection make sure
to check "Return matched rows instead of affected rows" flag. This will make the
ODBC driver to return affected rows properly. In our case the affected rows will
be 1.
To change the behaviour of the OperationStatus set the OperationStatus.HandleUpdateErrors
to False. In this way no error will be reported to the user.
APPLIES TO
- smartDBforms.NET 2.2 and later( MySQL is not supported
in the previous
versions ).
- MySQL with MySQL ODBC 5.1 Driver