Row was not deleted from generated DataSet

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for SQLite
Post Reply
imre.dudas
Posts: 18
Joined: Thu 11 Mar 2010 20:36

Row was not deleted from generated DataSet

Post by imre.dudas » Fri 06 Aug 2010 07:18

Hello,

I have written a little application, that require .NET 2.0. I don't want to use latest .NET, so I use DataSet technology.

I generated my DataSet with DataSet wizard, add, modify rows programmatically, but the Delete method (ds.Connections.RemoveConnectionsRow(Row)) is not work. My table name is Connections . :-)

I call Update method too.

I have checked events. ConnectionsRowDeleting was called, and the row is ok in event args. The ConnectionsRowDeleted method was not called.

What did I wrong?

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Fri 06 Aug 2010 16:55

Thank you for your report. I have checked the 2.90.152 version of dotConnect for SQLite. The RowDeleting and RowDeleted events are fired, and the row is deleted from DataTable. But Update() doesn't remove it from database. We will investigate the issue and notify you about the results as soon as possible.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Wed 18 Aug 2010 12:45

We have investigated the issue. This is a designed behaviour.
ds.Connections.RemoveConnectionsRow(Row) removes DataRow from the table of your dataset and marks it as Detached (but not Deleted). So, the Delete command is not executed in this case.

Please use ds.ConnectionsRows[0].Delete(); instead of ds.Connections.RemoveConnectionsRow(Row) to remove DataRow from your database.

Post Reply