Dataset DataRowState.Modified is returning an extra now that's was not modified?

JasonBoland

New member
Joined
Aug 22, 2007
Messages
4
Programming Experience
5-10
Dataset DataRowState.Modified is returning an extra row that was not modified?

Using VS 03 and also upgraded to VS 05 and have the same issue. Backend is SQL 2000 SP4.

Code is rather simple. Have a bunch of form objects bound to a DataAdapter/Dataset using a CurrencyManager.

Here is the example code.

VB.NET:
 ' Tell the CurrencyManager that we are done with edits (otherwise, the RowState property doesn't get set)
            cmCataloging.EndCurrentEdit()

            Dim dsdatasetchanged As New DataSet

            ' Get each row that changed in our dataset (should only be one at the most)
            'Dim dsDataSetChanged As DataSet = dsDataSet(dType.Cataloging).GetChanges(DataRowState.Modified)
            dsdatasetchanged = dsDataSet(dType.Cataloging).GetChanges(DataRowState.Modified)

            ' We have changes (again, should only be one [since we're saving after each change of position])
            If Not dsdatasetchanged Is Nothing Then
                daDataAdapter(dType.Cataloging).Update(dsdatasetchanged, "Cataloging")
                dsDataSet(dType.Cataloging).AcceptChanges()
            End If

dsdatasetchanged always contains two rows. One of the rows is correct and the other is a row that is not related in any way. As a matter of fact it's a row that I haven't even opened or looked at during my debugging.

It's always the same row also. If I edit row 5613 it's also trying to edit 5666.

Any ideas? I'm up on all patches, service packs, etc.
 
Last edited:
Back
Top