How to get a result set from a stored procedure?
This can be done in two ways. First, you can set MySqlCommand.CommandType to StoredProcedure and CommandText to the name of the procedure. Second, you can set MySqlCommand.CommandType to Text and CommandText to the CALL statement, for example, “CALL MyProc()”, where MyProc is the name of the procedure. After either setup, issue the MySqlCommand.ExecuteReader() method. If you need to retrieve just a scalar value from a stored function, you can do it through the parameter with Direction set to ParameterDirection.ReturnValue. For an example on how to do it, refer to the “Using Parameters” article in the dotConnect for MySQL documentation.