Bug #12927 MySqlParameterCollection.IndexOf returns MySqlExeption and not -1
Submitted: 1 Sep 2005 11:43 Modified: 14 Sep 2005 17:05
Reporter: Anton Eberharter Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / NET Severity:S3 (Non-critical)
Version:1.0.4 OS:Windows (Windows XP)
Assigned to: Reggie Burnett CPU Architecture:Any

[1 Sep 2005 11:43] Anton Eberharter
Description:
When you search with IndexOf in the MySqlParameterCollection and the string is not in there, you get an MySqlExeption and not -1

public int IndexOf( string parameterName )
{
   ......			
  throw new MySqlException("Parameter '" + parameterName + "' not found in collection");
}

change to

public int IndexOf( string parameterName )
{
   ......			
   return -1;
}

i hope this changes are no problem!
best regards

Toni
ps: i know, my english is very poor

How to repeat:
??
[14 Sep 2005 17:05] Reggie Burnett
Thank you for taking the time to report a problem.  Unfortunately
you are not using a current version of the product your reported a
problem with -- the problem might already be fixed. Please download
a new version from http://www.mysql.com/downloads/

If you are able to reproduce the bug with one of the latest versions,
please change the version on this bug report to the version you
tested and change the status back to "Open".  Again, thank you for
your continued support of MySQL.

Additional info:

This is fixed in 1.0.5