Share via


How to: Locate Changed Data in a DataSet (Visual Basic) 

This example uses the DataSet.HasChanges and the DataSet.GetChanges methods to check for and locate modified DataRow objects.

Example

Private Sub GetChangedRows()

    If dsNorthwind1.HasChanges Then

        Dim changedRecords As DataSet
        changedRecords = dsNorthwind1.GetChanges(DataRowState.Modified)

    Else
        MessageBox.Show("No Changes Found")
    End If
End Sub

Compiling the Code

This example requires:

  • A project reference to System.data.dll.

  • Access to the members of the System.Data namespace. Add an Imports statement if you are not fully qualifying member names in your code. For more information, see Imports Statement.

  • A dataset named DsNorthwind1.

See Also

Reference

DataRowState

Other Resources

Accessing Data (Visual Studio)
Preparing Your Application to Receive Data
Editing Data in Your Application