Hello, I started to use the trial edition of the MySQL .NET provider and the wizards in VS2003 C# Std.
I used the MySqlConnection object to create the connection - OK
I used the MySqlDataAdapter to access the database and the table, generating the SQL select and update commands - OK
I created the dataset using the data-adapter and I connected it to a datagrid and filled the dataset and the datagrid showed the data from the table - OK
When I ran the program it crashed with a System.Data.DuplicateNameException on the primary key field.
The sample programs run OK.
Have I used the components properly or is there a certain sequence of steps I should take when using the wizards or is better to just use code?
Regards
DuplicateNameException when using wizards and dataset
-
- Posts: 7
- Joined: Wed 03 May 2006 23:37
- Location: Melbourne, Australia
-
- Posts: 7
- Joined: Wed 03 May 2006 23:37
- Location: Melbourne, Australia
I found a fix...
I found that if I created the connection , data adapter and data set using the wizards and added the following code in the Form_Load Event solved my problem.
Where do I send the example project to?
Code: Select all
private void frmMain_Load(object sender, System.EventArgs e) {
mySqlConnectionPZC.Open();
mySqlDataAdapterGames.Fill( dsGames1, "GamesTbl" );
}