Bug #32732 ReturnGeneratedIdentifiers and Strong typed DataSets
Submitted: 26 Nov 2007 18:42 Modified: 22 Feb 2010 16:19
Reporter: Renaud Paquay Email Updates:
Status: Unsupported Impact on me:
None 
Category:Connector / NET Severity:S2 (Serious)
Version:5.1.4 OS:Any
Assigned to: CPU Architecture:Any
Tags: ReturnGeneratedIdentifiers

[26 Nov 2007 18:42] Renaud Paquay
Description:
As the 5.1.4 version introduced true as default value for ReturnGeneratedIdentifiers, the myslqCommand used in strong typed DataSet for UpdateCommand throws an Exception UpdatedDataRowSource must be set to none.

As the version doesn't provide a valid Update Command for strong typed datasets, if I add a CommandBuilder to it, the update command is generated but the exception is thrown.

How to repeat:
Generate a new xsd, drop a table into it.

In the InitAdapter method of the Designer.cs, add the following line :

this._builder = new MySql.Data.MySqlClient.MySqlCommandBuilder(_adapter);

in the partial class code, add :

namespace MyNameSpace.XXXXTableAdapters
{
    public partial class XXXXTableAdapter
    {
        private MySqlCommandBuilder _builder;

    }
}

execute the update command of the tableAdapter.

Suggested fix:
The generator should provide a MySqlCommand with some code like :

this._adapter.InsertCommand.UpdatedRowSource = global::System.Data.UpdateRowSource.None;
[3 Jul 2008 16:21] Coudray Jean-Sébastien
Same thing for me, even the UpdatedRowSource property is pushed to UpdateRowSource.None, the bug appear, not for the first Update() method call, but for the second call...

... pfff what to do when 5.1.3, 5.1.4, 5.2.1 have plenty of bugs... this connector is a vicious circle of critical and serious bugs....
[22 Feb 2010 16:19] Reggie Burnett
We are no longer supporting 5.x versions and we no longer use the ReturnGeneratedIdentifiers property.  Please download and try one of our 6.x products.