Bug #25771 MySqlParameterCollection no longer exposes a constructor
Submitted: 23 Jan 2007 8:40 Modified: 23 Jan 2007 16:06
Reporter: Samuel Zayas Email Updates:
Status: Not a Bug Impact on me:
None 
Category:Connector / NET Severity:S3 (Non-critical)
Version:1.0.8 RC OS:Windows (WinXP sp2)
Assigned to: CPU Architecture:Any
Tags: Constructor, MySqlParameterCollection

[23 Jan 2007 8:40] Samuel Zayas
Description:
According to the changelog for 1.0.8, no significant changes has been made to MySqlParameterCollection except for changing the IndexOf(string) method.

However, the class no longer exposes a constructor, thus making it impossible to create an instance of a MySqlParameterCollection.

This also affects MySqlHelper as it Execute methods no longer accepts a MySqlParameterCollection as parameter.

How to repeat:
[C#.NET]

MySqlParameterCollection _myCollection = new MySqlParameterCollection();

Suggested fix:
Version 1.0.7 allows creation of new instances.
[23 Jan 2007 16:06] Reggie Burnett
This is not a bug.  While previous versions of MySQL may have exposed a ctor for MySqlParameterCollection, this is not what we want.  In fact,  you'll see that SqlClient doesn't expose a ctor for it.

As for MySQLHelper, those functions do not take a MySqlParameterCollection.  They take an array of MySqlParameter objects.  This can be done using the C# params keyword or you can use something like an ArrayList.