91 references to Constraints
System.Data (91)
fx\src\data\System\Data\CodeGen\datacache.cs (8)
493
for (int j = 0; j < table.
Constraints
.Count; j++) {
494
if (!(table.
Constraints
[j] is UniqueConstraint)) {
498
if (!(((UniqueConstraint)(table.
Constraints
[j])).IsPrimaryKey)) {
502
DataColumn[] index = ((UniqueConstraint)table.
Constraints
[j]).ColumnsReference;
594
for (int i = 0; i < table.
Constraints
.Count; i++) {
595
if (!(table.
Constraints
[i] is UniqueConstraint)) {
599
UniqueConstraint uc = (UniqueConstraint)(table.
Constraints
[i]);
1264
foreach(Constraint constraint in table.
Constraints
) {
fx\src\data\System\Data\Constraint.cs (2)
54
Table.
Constraints
.RegisterName(value);
56
Table.
Constraints
.UnregisterName(name);
fx\src\data\System\Data\ConstraintCollection.cs (2)
122
UniqueConstraint key = fk.RelatedTable.
Constraints
.FindKeyConstraint(fk.RelatedColumnsReference);
130
fk.RelatedTable.
Constraints
.Add(key);
fx\src\data\System\Data\ConstraintEnumerator.cs (1)
39
constraints = ((DataTable)tables.Current).
Constraints
.GetEnumerator();
fx\src\data\System\Data\DataColumn.cs (13)
757
for (int i = 0; i < table.
Constraints
.Count; i++) {
758
if (table.
Constraints
[i].ContainsColumn(this)) {
759
throw ExceptionBuilder.ExpressionAndConstraint(this, table.
Constraints
[i]);
1042
UniqueConstraint key = table.
Constraints
.FindKeyConstraint(this);
1044
table.
Constraints
.Remove(key);
1058
table.
Constraints
.Add(key);
1132
UniqueConstraint constraint = table.
Constraints
.FindKeyConstraint(this);
1134
table.
Constraints
.CanRemove(constraint, true);
1238
for (System.Collections.IEnumerator e = Table.
Constraints
.GetEnumerator(); e.MoveNext(); ) {
1244
table.
Constraints
.CanRemove(oldConstraint, true);
1256
Debug.Assert(table.
Constraints
.FindKeyConstraint(this) == null, "Should not be a duplication constraint in collection");
1257
table.
Constraints
.Add(constraint);
1261
table.
Constraints
.Remove(oldConstraint);
fx\src\data\System\Data\DataColumnCollection.cs (4)
464
for (int i = 0; i < table.
Constraints
.Count; i++) {
465
if (table.
Constraints
[i].ContainsColumn(column))
469
throw ExceptionBuilder.CannotRemoveConstraint(table.
Constraints
[i].ConstraintName, table.
Constraints
[i].Table.TableName);
fx\src\data\System\Data\DataRelation.cs (2)
483
ForeignKeyConstraint constraint = ChildTable.
Constraints
.FindForeignKeyConstraint(ChildKey.ColumnsReference, ParentKey.ColumnsReference);
761
foreach (Constraint cs in ChildTable.
Constraints
) {
fx\src\data\System\Data\DataRelationCollection.cs (3)
720
ForeignKeyConstraint foreignKey = relation.ChildTable.
Constraints
.FindForeignKeyConstraint(relation.ParentColumnsReference, relation.ChildColumnsReference);
723
relation.ChildTable.
Constraints
.Add(foreignKey = new ForeignKeyConstraint(relation.ParentColumnsReference, relation.ChildColumnsReference));
739
UniqueConstraint key = relation.ParentTable.
Constraints
.FindKeyConstraint(relation.ParentColumnsReference);
fx\src\data\System\Data\DataSet.cs (6)
1066
Tables[i].
Constraints
.FinishInitConstraints();
1133
ConstraintCollection constraints = tbls[i].
Constraints
;
1140
ds.Tables[i].
Constraints
.Add(constraints[j].Clone(ds));
3009
ConstraintCollection cons = Tables[i].
Constraints
;
3043
constraints = Tables[i].
Constraints
;
3073
constraints = Tables[i].
Constraints
;
fx\src\data\System\Data\DataTable.cs (31)
487
for (int i = 0; i <
Constraints
.Count; i++) {
488
Constraint c =
Constraints
[i];
567
Constraints
.Add(uc);
599
Constraints
.Add(fk, false);
962
foreach (Constraint constraint in
Constraints
) {
1109
/// Resets the <see cref='System.Data.DataTable.
Constraints
'/> property to its default state.
1113
Constraints
.Clear();
1234
foreach (Constraint constr in
Constraints
)
1384
foreach (Constraint constraint in
Constraints
) {
1574
if ((existingKey = (UniqueConstraint)
Constraints
.FindConstraint(key)) != null) {
1597
Constraints
.Remove(oldKey);
1602
Constraints
.Add(key);
1606
Debug.Assert(
Constraints
.FindConstraint(primaryKey) == primaryKey, "PrimaryKey is not in ConstraintCollection");
1889
Constraints
.FinishInitConstraints();
2259
for (int j = 0; j <
Constraints
.Count; j++) {
2260
ForeignKeyConstraint foreign =
Constraints
[j] as ForeignKeyConstraint;
2261
UniqueConstraint unique =
Constraints
[j] as UniqueConstraint;
2265
Constraint oldConstraint = clone.
Constraints
.FindConstraint(clonedConstraint);
2267
oldConstraint.ConstraintName =
Constraints
[j].ConstraintName;
2273
Constraint oldConstraint = clone.
Constraints
.FindConstraint(clonedConstraint);
2275
oldConstraint.ConstraintName =
Constraints
[j].ConstraintName;
2284
for (int j = 0; j <
Constraints
.Count; j++) {
2285
if (! clone.
Constraints
.Contains(
Constraints
[j].ConstraintName, true)) {
2286
ForeignKeyConstraint foreign =
Constraints
[j] as ForeignKeyConstraint;
2287
UniqueConstraint unique =
Constraints
[j] as UniqueConstraint;
2292
clone.
Constraints
.Add(newforeign);
2297
clone.
Constraints
.Add(unique.Clone(clone));
5821
foreach(Constraint tempConstrain in sourceTable.
Constraints
) {
5827
if (!destinationTable.
Constraints
.Contains(newFKC.ConstraintName))
5828
destinationTable.
Constraints
.Add(newFKC); // we know that the dest table is already in the table
fx\src\data\System\Data\DataTableCollection.cs (2)
294
foreach (Constraint constr in table.
Constraints
) {
351
foreach (Constraint constr in table.
Constraints
) {
fx\src\data\System\Data\Merger.cs (5)
394
for (int i = 0; i < table.
Constraints
.Count; i++) {
395
Constraint src = table.
Constraints
[i];
405
Constraint cons = dest.Table.
Constraints
.FindConstraint(dest);
410
dest.Table.
Constraints
.Add(dest);
415
dest.Table.
Constraints
.Add(dest);
fx\src\data\System\Data\ProviderBase\SchemaMapping.cs (1)
927
ConstraintCollection constraints = _dataTable.
Constraints
;
fx\src\data\System\Data\xmlsaver.cs (5)
258
foreach(Constraint constr in table.
Constraints
) {
380
foreach (Constraint cs in dt.
Constraints
) {
391
UniqueConstraint _constraint = (UniqueConstraint) fk.RelatedTable.
Constraints
.FindConstraint( new UniqueConstraint( "TEMP", fk.RelatedColumnsReference));
1705
ConstraintCollection constraints = table.
Constraints
;
1796
UniqueConstraint _constraint = (UniqueConstraint) foreign.RelatedTable.
Constraints
.FindConstraint( new UniqueConstraint( "TEMP", fields));
fx\src\data\System\Data\XMLSchema.cs (6)
1113
int iExisting = fKey[0].Table.
Constraints
.InternalIndexOf(name);
1115
if (fKey[0].Table.
Constraints
[iExisting].ConstraintName != name)
1121
fKey[0].Table.
Constraints
.Add(fkc);
1207
UniqueConstraint found = (UniqueConstraint) key[0].Table.
Constraints
.FindConstraint(new UniqueConstraint(name, key));
1210
key[0].Table.
Constraints
.Add(name, key, fPrimaryKey);
1211
SetExtProperties(key[0].Table.
Constraints
[name], keyNode.UnhandledAttributes);