Bug #14688 | Object reference not set to an instance of an object. Output parameter not set | ||
---|---|---|---|
Submitted: | 6 Nov 2005 23:45 | Modified: | 7 Nov 2005 10:19 |
Reporter: | greg perowne | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | Connector / NET | Severity: | S3 (Non-critical) |
Version: | 1.0.6 527 | OS: | Windows (Windows XP) |
Assigned to: | CPU Architecture: | Any |
[6 Nov 2005 23:45]
greg perowne
[6 Nov 2005 23:56]
greg perowne
Web Project and script file to produce problem
Attachment: Bugtest.zip (application/x-zip-compressed, text), 10.24 KiB.
[7 Nov 2005 0:09]
greg perowne
The problem occurs regardless of whether or not there are additional results with the output parameter. It appears that MySqlDataReader cannot handle output parameter results.
[7 Nov 2005 9:12]
greg perowne
Just to prove the point by commenting out the ExecuteReader and the NextResult() code, and adding myCommand.ExecuteNonQuery(); The output parameter is returned correctly. Of course this isn't a workaround because you have to use ExecuteReader when a sp returns resultsets and output parameters.
[7 Nov 2005 10:19]
greg perowne
OK this is most probably by design. The parameters are populated fine as long as the Close() is actioned prior to obtaining the parameter.value. There is obviously a slight discrepency between the behaviour of SQLDataReader and MySqlDataReader. But having moved the close() it works fine.