Bug #32732 ReturnGeneratedIdentifiers and Strong typed DataSets
Submitted: 26 Nov 2007 19:42 Modified: 26 Nov 2007 21:22
Reporter: Renaud Paquay
Status: Analyzing
Category:Connector/Net Severity:S2 (Serious)
Version:5.1.4 OS:Any
Assigned to: Tonci Grgin Target Version:
Tags: ReturnGeneratedIdentifiers

[26 Nov 2007 19: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 18: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....