static private GetChildRows ( |
||
parentKey | ||
childKey | ||
parentRow | ||
version | DataRowVersion | |
리턴 | System.Data.DataRow[] |
internal void CheckCanRemoveParentRow(DataRow row) { if (this.Table.DataSet.EnforceConstraints && (DataRelation.GetChildRows(this.ParentKey, this.ChildKey, row, DataRowVersion.Default).Length > 0)) { throw ExceptionBuilder.RemoveParentRow(this); } }
/// <include file='doc\DataRow.uex' path='docs/doc[@for="DataRow.GetChildRows3"]/*' /> /// <devdoc> /// <para>Gets the child rows of this <see cref='System.Data.DataRow'/> using the specified <see cref='System.Data.DataRelation'/> and the specified <see cref='System.Data.DataRowVersion'/></para> /// </devdoc> public DataRow[] GetChildRows(DataRelation relation, DataRowVersion version) { if (relation == null) { return(Table.NewRowArray(0)); } if (Table == null) { throw ExceptionBuilder.RowNotInTheTable(); } if (relation.DataSet != Table.DataSet) { throw ExceptionBuilder.RowNotInTheDataSet(); } if (relation.ParentKey.Table != Table) { throw ExceptionBuilder.RelationForeignTable(relation.ParentTable.TableName, Table.TableName); } Index index = relation.ChildKey.GetSortIndex(); return(DataRelation.GetChildRows(relation.ParentKey, relation.ChildKey, this, version)); }
internal void CheckCanRemoveParentRow(DataRow row) { Debug.Assert(Table.DataSet != null, "Relation " + ConstraintName + " isn't part of a DataSet, so this check shouldn't be happening."); if (!Table.DataSet.EnforceConstraints) { return; } if (DataRelation.GetChildRows(this.ParentKey, this.ChildKey, row, DataRowVersion.Default).Length > 0) { throw ExceptionBuilder.RemoveParentRow(this); } }