internal override void CheckConstraint(DataRow row, DataRowAction action) { if (Table.EnforceConstraints && (action == DataRowAction.Add || action == DataRowAction.Change || (action == DataRowAction.Rollback && row._tempRecord != -1))) { if (row.HaveValuesChanged(ColumnsReference)) { if (ConstraintIndex.IsKeyRecordInIndex(row.GetDefaultRecord())) { object[] values = row.GetColumnValues(ColumnsReference); throw ExceptionBuilder.ConstraintViolation(ColumnsReference, values); } } } }
internal override void CheckConstraint(DataRow row, DataRowAction action) { if (Table.EnforceConstraints && (action == DataRowAction.Add || action == DataRowAction.Change || (action == DataRowAction.Rollback && row.tempRecord != -1))) { if (row.HaveValuesChanged(ColumnsReference)) { if (ConstraintIndex.IsKeyRecordInIndex(row.GetDefaultRecord())) { object[] values = row.GetColumnValues(ColumnsReference); throw ExceptionBuilder.ConstraintViolation(ColumnsReference, values); } } } }
internal void CheckMaxLength(DataRow dr) { if (0 <= _maxLength) { Debug.Assert(IsStringType, "not a String or SqlString column"); if (_maxLength < GetStringLength(dr.GetDefaultRecord())) { throw ExceptionBuilder.LongerThanMaxLength(this); } } }
internal void CheckNullable(DataRow row) { if (!AllowDBNull) { Debug.Assert(null != _storage, "no storage"); if (_storage.IsNull(row.GetDefaultRecord())) { throw ExceptionBuilder.NullValues(ColumnName); } } }
internal override void CheckConstraint(DataRow row, DataRowAction action) { if ((this.Table.EnforceConstraints && (((action == DataRowAction.Add) || (action == DataRowAction.Change)) || ((action == DataRowAction.Rollback) && (row.tempRecord != -1)))) && (row.HaveValuesChanged(this.ColumnsReference) && this.ConstraintIndex.IsKeyRecordInIndex(row.GetDefaultRecord()))) { object[] columnValues = row.GetColumnValues(this.ColumnsReference); throw ExceptionBuilder.ConstraintViolation(this.ColumnsReference, columnValues); } }