DataRow.SetModified Method
Assembly: System.Data (in system.data.dll)
Changes the Rowstate of a DataRow to Modified. If the current row is not in either an Unchanged or an Added state, it throws an InvalidOperationException with the message that SetModified can only be invoked on a DataRow instance where the RowState is Unchanged.
Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.
If the current row is not in either an Unchanged or an Added state, it throws an InvalidOperationException with the message that SetModified can only be invoked on a DataRow instance where the RowState is Unchanged.
Looking at the .NET 2.0 framework source code using Reflector, it clearly only allows SetModified() to be called if the RowState is Unchanged and does not allow for rows in an Added state to be set to modified.
- 11/12/2007
- Giorgio Galante
- 11/13/2007
- Noelle Mallory