Is there any way in C# to check if the datatable values are changed or not from the time it is loaded from DB ? But I know we can check the DataRowState to identify it. But here I want to avoid or neglect a particular column when checking the DataRowState for a DataRow. Simple code is shown here.
foreach (DataRow dr in DataTable.Rows)
{
if (dr.RowState != DataRowState.Unchanged)
{
// code
}
}
When checking the DataRowState for a DataRow, how can i neglect or avoid a column and check all the values of the other columns in the DataRow ?
Something like as shown below :
// avoid Status column value and consider all other column values in the row.
foreach (DataRow dr in DataTable.Rows.Where(not Status column))
{
if (dr.RowState != DataRowState.Unchanged)
{
// code
}
}