Skip to content

MySqlDataAdapter.Update fails - MySqlCommand disposed object #1285

@patrik-osgnach

Description

@patrik-osgnach

Hi, I'm porting some code which uses MySql.Data to MySqlConnector and I'm facing an issue when I want to run an insert operation
I have an instance of MySqlDataAdapter, I call the Update method and I pass a DataTable.
The DataAdapter has the InsertCommand property defined.
After the Update() call, the HasErrors property of the DataTable is true. The last row has RowState=Added, the ItemArray has the values I want to insert but the RowError property is

"Cannot access a disposed object.\r\nObject name: 'MySqlCommand'."
The InsertCommand is not null after the call to Update()

Any idea how can I debug this further?
I'm using MySqlConnector 2.2.5 and the DB is MariaDB 10.6.11

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions