GetChildRows() static private method

Gets the child rows for the parent row across the relation using the version given
static private GetChildRows ( DataKey parentKey, DataKey childKey, DataRow parentRow, DataRowVersion version ) : System.Data.DataRow[]
parentKey DataKey
childKey DataKey
parentRow DataRow
version DataRowVersion
return System.Data.DataRow[]
Exemplo n.º 1
0
 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);
     }
 }
Exemplo n.º 2
0
        /// <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));
        }
Exemplo n.º 3
0
 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);
     }
 }