Hi I have a method which updates a MySQL table using a query. I\'m using a MS Visual Studio and phpmyadmin as the SQL client.
Method:
public static Memb
An alternative to the post of @Sajeetharan is that you return the value of your ExecuteNonQuery call
connection.Open();
cmd = connection.CreateCommand();
cmd.CommandText = query;
return cmd.ExecuteNonQuery();
Of course you also have to return something at the end of your method (after the finally block).
For UPDATE, INSERT, and DELETE statements, the return value is the number of rows affected by the command. When a trigger exists on a table being inserted or updated, the return value includes the number of rows affected by both the insert or update operation and the number of rows affected by the trigger or triggers. For all other types of statements, the return value is -1. If a rollback occurs, the return value is also -1.
Reference