| Bug #27187 | cmd.Parameters.RemoveAt("Id") will cause an error if the last item is requested | ||
|---|---|---|---|
| Submitted: | 15 Mar 2007 18:56 | Modified: | 26 Mar 2007 8:22 |
| Reporter: | Paul van Keulen | ||
| Status: | Closed | ||
| Category: | Connector/Net | Severity: | S2 (Serious) |
| Version: | 5.0.5 | OS: | Microsoft Windows (WinXP) |
| Assigned to: | Target Version: | ||
| Tags: | Parameter;RemoveAt;GetParameter;IndexOf | ||
[19 Mar 2007 23:34]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/22314
[26 Mar 2007 8:22]
MC Brown
A note has been added to the 5.0.6 changelog.

Description: Hello Something with removing parameters in the MySql .NET driver version 5.0.5 is not working correctly. I have a MySqlCommand with 6 Parameters: cmd.Parameters["Id"] cmd.Parameters["Field1"] cmd.Parameters["Field2"] cmd.Parameters["Field3"] cmd.Parameters["Field4"] cmd.Parameters["Field5"] When I remove the parameter Id with: cmd.Parameters.RemoveAt("Id"); After that I want to get the value or the indexOf(..), of Parameter Field5 with this.GetParameter("Field5", dr["Field5"], ParameterDirection.Output). Then I will get an ArgumentOutOfRangeException. It worked perfectly with the 1.0.7 driver. Greetings, Paul How to repeat: Fill the parameters collection of the command with multiple values. Then remove one or more values at the beginning of the collection. After try to get the last Field on name with GetParameter("Fieldxx", dr["Fieldxx"], ParameterDirection.Output).