System.Data.DataRow.ClearErrors C# (CSharp) Method

ClearErrors() public method

Clears the errors for the row, including the and errors set with
public ClearErrors ( ) : void
return void
        public void ClearErrors()
        {
            if (_error != null)
            {
                _error.Clear();
                RowErrorChanged();
            }
        }

Usage Example

        private static bool ISSingleRowValid(DataRow dr)
        {
            dr.ClearErrors();
            bool isValid = true;
            if (dr["InventoryDamagedQuantity"] != DBNull.Value && ((Convert.ToDecimal(dr["InventoryDamagedQuantity"]) > 0) && (dr["DamagedPalletLocationID"] == DBNull.Value)))
            {
                dr.SetColumnError("DamagedPalletLocationID",
                                  Icons.YearEndProcess_ValidateBeforeCommit_DamagedPalletLocation_Can_not_be_left_empty_);
                isValid = false;
            }

            if (dr["InventorySoundQuantity"] != DBNull.Value && ((Convert.ToDecimal(dr["InventorySoundQuantity"]) > 0) && (dr["PalletLocationID"] == DBNull.Value)))
            {
                dr.SetColumnError("PalletLocationID",
                                  Icons.YearEndProcess_ValidateBeforeCommit_Normal_PalletLocation_Can_not_be_left_empty_);
                isValid = false;
            }

            return isValid;
        }
All Usage Examples Of System.Data.DataRow::ClearErrors