Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ Create()

void System.Data.DataRelation.Create ( string relationName,
DataColumn[] parentColumns,
DataColumn[] childColumns,
bool createConstraints )
inlineprivate

Definition at line 524 of file DataRelation.cs.

525 {
526 long scopeId = DataCommonEventSource.Log.EnterScope("<ds.DataRelation.Create|INFO> {0}, relationName='{1}', createConstraints={2}", ObjectID, relationName, createConstraints);
527 try
528 {
529 _parentKey = new DataKey(parentColumns, copyColumns: true);
530 _childKey = new DataKey(childColumns, copyColumns: true);
531 if (parentColumns.Length != childColumns.Length)
532 {
533 throw ExceptionBuilder.KeyLengthMismatch();
534 }
535 for (int i = 0; i < parentColumns.Length; i++)
536 {
537 if (parentColumns[i].Table.DataSet == null || childColumns[i].Table.DataSet == null)
538 {
539 throw ExceptionBuilder.ParentOrChildColumnsDoNotHaveDataSet();
540 }
541 }
542 CheckState();
543 _relationName = ((relationName == null) ? "" : relationName);
545 }
546 finally
547 {
548 DataCommonEventSource.Log.ExitScope(scopeId);
549 }
550 }

References System.Data.DataRelation._childKey, System.Data.DataRelation._createConstraints, System.Data.DataRelation._parentKey, System.Data.DataRelation._relationName, System.Data.DataRelation.CheckState(), System.Data.ExceptionBuilder.KeyLengthMismatch(), System.Data.DataCommonEventSource.Log, System.Data.DataRelation.ObjectID, and System.Data.ExceptionBuilder.ParentOrChildColumnsDoNotHaveDataSet().

Referenced by System.Data.DataRelation.DataRelation(), and System.Data.DataRelation.DataRelation().