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

◆ SetParentRow() [2/2]

void System.Data.DataRow.SetParentRow ( DataRow? parentRow,
DataRelation? relation )
inline

Definition at line 1126 of file DataRow.cs.

1127 {
1128 if (relation == null)
1129 {
1131 return;
1132 }
1133 if (parentRow == null)
1134 {
1136 return;
1137 }
1138 if (_table.DataSet != parentRow._table.DataSet)
1139 {
1140 throw ExceptionBuilder.ParentRowNotInTheDataSet();
1141 }
1142 if (relation.ChildKey.Table != _table)
1143 {
1144 throw ExceptionBuilder.SetParentRowTableMismatch(relation.ChildKey.Table.TableName, _table.TableName);
1145 }
1146 if (relation.ParentKey.Table != parentRow._table)
1147 {
1148 throw ExceptionBuilder.SetParentRowTableMismatch(relation.ParentKey.Table.TableName, parentRow._table.TableName);
1149 }
1150 object[] keyValues = parentRow.GetKeyValues(relation.ParentKey);
1151 SetKeyValues(relation.ChildKey, keyValues);
1152 }
void SetParentRow(DataRow? parentRow)
Definition DataRow.cs:1121
void SetKeyValues(DataKey key, object[] keyValues)
Definition DataRow.cs:1064
void SetParentRowToDBNull()
Definition DataRow.cs:1154
readonly DataTable _table
Definition DataRow.cs:12

References System.Data.DataSet.DataSet(), System.Data.DataRow._table, System.Data.DataTable.DataSet, System.Xml.Dictionary, System.Data.ExceptionBuilder.ParentRowNotInTheDataSet(), System.Data.DataRow.SetKeyValues(), System.Data.DataRow.SetParentRow(), System.Data.ExceptionBuilder.SetParentRowTableMismatch(), System.Data.DataRow.SetParentRowToDBNull(), and System.Data.DataTable.TableName.