Bug #6405 System.ArgumentException in mysql.data.dll
Submitted: 3 Nov 2004 16:49 Modified: 4 Nov 2004 16:25
Reporter: [ name withheld ] Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / NET Severity:S2 (Serious)
Version:Beta 1.0.0 OS:Windows (XP)
Assigned to: Reggie Burnett CPU Architecture:Any

[3 Nov 2004 16:49] [ name withheld ]
Description:
I'm using a mysql version 5.0.0-alpha-nt running on windows xp, i'm trying to connect a database named "gescom" from a c# program.

When I Click on my button to open the connection, a 'System.ArgumentException' is raised here is the message (in french sorry): 

Une exception non gérée du type 'System.ArgumentException' s'est produite dans mysql.data.dll

Informations supplémentaires : L'élément a déjà été ajouté. Clé du dictionnaire : "read_only"  Clé ajoutée : "read_only"

I used the same code with ByteFx....and it worked....I have this message since i use the new connector...

Thanks a lot
Sebastien

How to repeat:
here is the code I use :
using MySql.Data.MySqlClient;
...
private MySqlConnection maConnect = null;

private void button_XP1_Click(object sender, System.EventArgs e)
{
try
{
	maConnect =new MySqlConnection("Host=Localhost;Database=gescom;user id=XXXX;password=XXXXX;");
	maConnect.Open();
}
catch(Exception xcp)
{
	MessageBox.Show(xcp.Message);
}
}

I have tried this :
using MySql.Data.MySqlClient;
...
private MySqlConnection maConnect = null;

private void button_XP1_Click(object sender, System.EventArgs e)
{
try
{
	maConnect =new MySqlConnection("Host=Localhost;Database=gescom;user id=XXXX;password=XXXXX;");
	maConnect.Open();
}
catch(System.ArgumentException xcp_arg)
{
}
catch(Exception xcp)
{
	MessageBox.Show(xcp.Message);
}
}

then the error is raised but the connection seems to be open(according to the maConnect.State).
After that I tried to fill a dataset with a dataadapter but it didn't work, the dataset was empty and I trapped the same error.
here is the code :

try
{
	DataSet ds = new DataSet();
	maConnect =new MySqlConnection("Host=Localhost;Database=gescom;user id=XXXX;password=XXXXX;");
	MySqlDataAdapter monDataAdapter = new MySqlDataAdapter("select * from T_CIVILITE",maConnect);
				
	monDataAdapter.Fill(ds, "T_CIVILITE");
	dg_Liste1.DataSource = ds.Tables["T_CIVILITE"];
}
catch(System.ArgumentException xcp_arg)
{
}
catch(Exception xcp)
{
	MessageBox.Show(xcp.Message);
}
[4 Nov 2004 15:21] Reggie Burnett
Can you give me more of an english translation?  It looks like it is saying that read_only has already been added to the collection.  This was a bug in version 1.0.0 but was corrected for 1.0.1.  Are you sure you have rebuilt your program using the new 1.0.1?
[4 Nov 2004 16:09] [ name withheld ]
Sorry I made a mistake in my version number.....
I was using the beta 1.0.0
i have downloaded the beta 1.0.1 and it works fine....
you can mark this as completed...

sorry for the disagreement.

Sebastien
[4 Nov 2004 16:25] 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.