Synopsis
DataTable ds
= Constraint.Table;
Retrieves the DataTable
object that the
Constraint
belongs to.
Example
The following code retrieves the containing
DataTable
and displays some basic information
about it in a console window:
DataTable dt = dr.Table;
// Print the name and number of rows of the child table.
Console.WriteLine(dt.TableName, dt.Rows.Count.ToString());
Note
In the case of a ForeignKeyConstraint
, this is the
child table in which the constraint is applied. The parent table can
be retrieved through the
ForeignKeyConstraint.RelatedTable
property.