Delete row and GetChanges

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am stumped. I have a strongly-typed dataset with many related tables. I
delete a row using Rows.Find to get the row and then call Row.Delete.
However, even though it is no longer visible in the DataSet, calls to
GetChanges and DefaultView after RowStateFilter = DataViewRowState.Deleted
come up with Nothing and 0 respectively.

Also, calling the Update command for the DataTable table that owns this Row
does not delete the value in the database.

I also tried a raw ds.tables(0).Rows(0).Delete and still no effect. The row
I am trying to delete is a parent row to other rows and the DataSet relation
is setup to Cascade on Delete (so is the SQL Server database).

The Row.Delete seems to be working like Row.Remove.

If I wip up a simple untyped example it works just fine.
 
Buzz,
Also, calling the Update command for the DataTable table that owns this
Row
does not delete the value in the database.


The Row.Delete seems to be working like Row.Remove.
The Row.Delete works as Row.Remove after a fill with acceptchangesafterFill
false and with new created records that have not had an acceptchanges.

Can it be that?

Cor
 
Cor,

I went hunting through my code at your mention of AcceptChanges. In trying
to troubleshoot another problem, I'd put an AcceptChanges onto the
DataTable's RowDeleted event! So everytime I was calling delete it was
calling AcceptChanges in another module! D'oh! Maybe coding 24/7 is not such
a good idea... Thanks for the second pair of eyes.
 
Back
Top