1 <?xml version="1.0" encoding="utf-8"?>
2 <Type Name="ForeignKeyConstraint" FullName="System.Data.ForeignKeyConstraint">
3 <TypeSignature Language="C#" Value="public class ForeignKeyConstraint : System.Data.Constraint" Maintainer="auto" />
5 <AssemblyName>System.Data</AssemblyName>
6 <AssemblyPublicKey>[00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00]</AssemblyPublicKey>
7 <AssemblyVersion>1.0.3300.0</AssemblyVersion>
8 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
9 <AssemblyVersion>2.0.0.0</AssemblyVersion>
11 <ThreadSafetyStatement>Gtk# is thread aware, but not thread safe; See the <link location="node:gtk-sharp/programming/threads">Gtk# Thread Programming</link> for details.</ThreadSafetyStatement>
13 <BaseTypeName>System.Data.Constraint</BaseTypeName>
18 <AttributeName>System.ComponentModel.DefaultProperty("ConstraintName")</AttributeName>
21 <AttributeName>System.ComponentModel.Editor("Microsoft.VSDesigner.Data.Design.ForeignKeyConstraintEditor, Microsoft.VSDesigner, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.Drawing.Design.UITypeEditor, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")</AttributeName>
26 <attribution license="cc4" from="Microsoft" modified="false" />
27 <para>A <see cref="T:System.Data.ForeignKeyConstraint" /> restricts the action performed when a value in a column (or columns) is either deleted or updated. Such a constraint is intended to be used with primary key columns. In a parent/child relationship between two tables, deleting a value from the parent table can affect the child rows in one of the following ways.</para>
30 <para>The child rows can also be deleted (a cascading action).</para>
33 <para>The values in the child column (or columns) can be set to null values.</para>
36 <para>The values in the child column (or columns) can be set to default values.</para>
39 <para>An exception can be generated.</para>
43 <see cref="T:System.Data.ForeignKeyConstraint" /> objects are contained in the <see cref="T:System.Data.ConstraintCollection" /> of a <see cref="T:System.Data.DataTable" />, which is accessed through the <see cref="P:System.Data.DataTable.Constraints" /> property.</para>
44 <para>Constraints are not enforced unless the <see cref="P:System.Data.DataSet.EnforceConstraints" /> property is set to true.</para>
45 <para>The <see cref="P:System.Data.ForeignKeyConstraint.AcceptRejectRule" /> is enforced whenever a <see cref="T:System.Data.DataTable" /> object's <see cref="M:System.Data.DataTable.AcceptChanges" /> method is invoked.</para>
48 <attribution license="cc4" from="Microsoft" modified="false" />
49 <para>Represents an action restriction enforced on a set of columns in a primary key/foreign key relationship when a value or row is either deleted or updated.</para>
53 <Member MemberName=".ctor">
54 <MemberSignature Language="C#" Value="public ForeignKeyConstraint (System.Data.DataColumn parentColumn, System.Data.DataColumn childColumn);" />
55 <MemberType>Constructor</MemberType>
58 <Parameter Name="parentColumn" Type="System.Data.DataColumn" />
59 <Parameter Name="childColumn" Type="System.Data.DataColumn" />
62 <remarks>To be added</remarks>
64 <attribution license="cc4" from="Microsoft" modified="false" />
65 <para>Initializes a new instance of the <see cref="T:System.Data.ForeignKeyConstraint" /> class with the specified parent and child <see cref="T:System.Data.DataColumn" /> objects.</para>
67 <param name="parentColumn">
68 <attribution license="cc4" from="Microsoft" modified="false" />The parent <see cref="T:System.Data.DataColumn" /> in the constraint. </param>
69 <param name="childColumn">
70 <attribution license="cc4" from="Microsoft" modified="false" />The child <see cref="T:System.Data.DataColumn" /> in the constraint. </param>
73 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
74 <AssemblyVersion>2.0.0.0</AssemblyVersion>
77 <Member MemberName=".ctor">
78 <MemberSignature Language="C#" Value="public ForeignKeyConstraint (System.Data.DataColumn[] parentColumns, System.Data.DataColumn[] childColumns);" />
79 <MemberType>Constructor</MemberType>
82 <Parameter Name="parentColumns" Type="System.Data.DataColumn[]" />
83 <Parameter Name="childColumns" Type="System.Data.DataColumn[]" />
86 <remarks>To be added</remarks>
88 <attribution license="cc4" from="Microsoft" modified="false" />
89 <para>Initializes a new instance of the <see cref="T:System.Data.ForeignKeyConstraint" /> class with the specified arrays of parent and child <see cref="T:System.Data.DataColumn" /> objects.</para>
91 <param name="parentColumns">
92 <attribution license="cc4" from="Microsoft" modified="false" />An array of parent <see cref="T:System.Data.DataColumn" /> in the constraint. </param>
93 <param name="childColumns">
94 <attribution license="cc4" from="Microsoft" modified="false" />An array of child <see cref="T:System.Data.DataColumn" /> in the constraint. </param>
97 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
98 <AssemblyVersion>2.0.0.0</AssemblyVersion>
101 <Member MemberName=".ctor">
102 <MemberSignature Language="C#" Value="public ForeignKeyConstraint (string constraintName, System.Data.DataColumn parentColumn, System.Data.DataColumn childColumn);" />
103 <MemberType>Constructor</MemberType>
106 <Parameter Name="constraintName" Type="System.String" />
107 <Parameter Name="parentColumn" Type="System.Data.DataColumn" />
108 <Parameter Name="childColumn" Type="System.Data.DataColumn" />
111 <remarks>To be added</remarks>
113 <attribution license="cc4" from="Microsoft" modified="false" />
114 <para>Initializes a new instance of the <see cref="T:System.Data.ForeignKeyConstraint" /> class with the specified name, parent and child <see cref="T:System.Data.DataColumn" /> objects.</para>
116 <param name="constraintName">
117 <attribution license="cc4" from="Microsoft" modified="false" />The name of the constraint. </param>
118 <param name="parentColumn">
119 <attribution license="cc4" from="Microsoft" modified="false" />The parent <see cref="T:System.Data.DataColumn" /> in the constraint. </param>
120 <param name="childColumn">
121 <attribution license="cc4" from="Microsoft" modified="false" />The child <see cref="T:System.Data.DataColumn" /> in the constraint. </param>
124 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
125 <AssemblyVersion>2.0.0.0</AssemblyVersion>
128 <Member MemberName=".ctor">
129 <MemberSignature Language="C#" Value="public ForeignKeyConstraint (string constraintName, System.Data.DataColumn[] parentColumns, System.Data.DataColumn[] childColumns);" />
130 <MemberType>Constructor</MemberType>
133 <Parameter Name="constraintName" Type="System.String" />
134 <Parameter Name="parentColumns" Type="System.Data.DataColumn[]" />
135 <Parameter Name="childColumns" Type="System.Data.DataColumn[]" />
138 <remarks>To be added</remarks>
140 <attribution license="cc4" from="Microsoft" modified="false" />
141 <para>Initializes a new instance of the <see cref="T:System.Data.ForeignKeyConstraint" /> class with the specified name, and arrays of parent and child <see cref="T:System.Data.DataColumn" /> objects.</para>
143 <param name="constraintName">
144 <attribution license="cc4" from="Microsoft" modified="false" />The name of the <see cref="T:System.Data.ForeignKeyConstraint" />. If null or empty string, a default name will be given when added to the constraints collection. </param>
145 <param name="parentColumns">
146 <attribution license="cc4" from="Microsoft" modified="false" />An array of parent <see cref="T:System.Data.DataColumn" /> in the constraint. </param>
147 <param name="childColumns">
148 <attribution license="cc4" from="Microsoft" modified="false" />An array of child <see cref="T:System.Data.DataColumn" /> in the constraint. </param>
151 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
152 <AssemblyVersion>2.0.0.0</AssemblyVersion>
155 <Member MemberName=".ctor">
156 <MemberSignature Language="C#" Value="public ForeignKeyConstraint (string constraintName, string parentTableName, string[] parentColumnNames, string[] childColumnNames, System.Data.AcceptRejectRule acceptRejectRule, System.Data.Rule deleteRule, System.Data.Rule updateRule);" />
157 <MemberType>Constructor</MemberType>
160 <Parameter Name="constraintName" Type="System.String" />
161 <Parameter Name="parentTableName" Type="System.String" />
162 <Parameter Name="parentColumnNames" Type="System.String[]" />
163 <Parameter Name="childColumnNames" Type="System.String[]" />
164 <Parameter Name="acceptRejectRule" Type="System.Data.AcceptRejectRule" />
165 <Parameter Name="deleteRule" Type="System.Data.Rule" />
166 <Parameter Name="updateRule" Type="System.Data.Rule" />
169 <remarks>To be added</remarks>
171 <attribution license="cc4" from="Microsoft" modified="false" />
172 <para>This constructor is provided for design time support in the Visual Studio environment. <see cref="T:System.Data.ForeignKeyConstraint" /> objects created by using this constructor must then be added to the collection via <see cref="M:System.Data.ConstraintCollection.AddRange(System.Data.Constraint[])" />. Tables and columns with the specified names must exist at the time the method is called, or if <see cref="M:System.Data.DataTable.BeginInit" /> has been called prior to calling this constructor, the tables and columns with the specified names must exist at the time that <see cref="M:System.Data.DataTable.EndInit" /> is called.</para>
174 <param name="constraintName">
175 <attribution license="cc4" from="Microsoft" modified="false" />The name of the constraint. </param>
176 <param name="parentTableName">
177 <attribution license="cc4" from="Microsoft" modified="false" />The name of the parent <see cref="T:System.Data.DataTable" /> that contains parent <see cref="T:System.Data.DataColumn" /> objects in the constraint. </param>
178 <param name="parentColumnNames">
179 <attribution license="cc4" from="Microsoft" modified="false" />An array of the names of parent <see cref="T:System.Data.DataColumn" /> objects in the constraint. </param>
180 <param name="childColumnNames">
181 <attribution license="cc4" from="Microsoft" modified="false" />An array of the names of child <see cref="T:System.Data.DataColumn" /> objects in the constraint. </param>
182 <param name="acceptRejectRule">
183 <attribution license="cc4" from="Microsoft" modified="false" />One of the <see cref="T:System.Data.AcceptRejectRule" /> values. Possible values include None, Cascade, and Default. </param>
184 <param name="deleteRule">
185 <attribution license="cc4" from="Microsoft" modified="false" />One of the <see cref="T:System.Data.Rule" /> values to use when a row is deleted. The default is Cascade. Possible values include: None, Cascade, SetNull, SetDefault, and Default. </param>
186 <param name="updateRule">
187 <attribution license="cc4" from="Microsoft" modified="false" />One of the <see cref="T:System.Data.Rule" /> values to use when a row is updated. The default is Cascade. Possible values include: None, Cascade, SetNull, SetDefault, and Default. </param>
190 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
191 <AssemblyVersion>2.0.0.0</AssemblyVersion>
195 <AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
199 <Member MemberName=".ctor">
200 <MemberSignature Language="C#" Value="public ForeignKeyConstraint (string constraintName, string parentTableName, string parentTableNamespace, string[] parentColumnNames, string[] childColumnNames, System.Data.AcceptRejectRule acceptRejectRule, System.Data.Rule deleteRule, System.Data.Rule updateRule);" />
201 <MemberType>Constructor</MemberType>
203 <AssemblyVersion>2.0.0.0</AssemblyVersion>
207 <AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
211 <Parameter Name="constraintName" Type="System.String" />
212 <Parameter Name="parentTableName" Type="System.String" />
213 <Parameter Name="parentTableNamespace" Type="System.String" />
214 <Parameter Name="parentColumnNames" Type="System.String[]" />
215 <Parameter Name="childColumnNames" Type="System.String[]" />
216 <Parameter Name="acceptRejectRule" Type="System.Data.AcceptRejectRule" />
217 <Parameter Name="deleteRule" Type="System.Data.Rule" />
218 <Parameter Name="updateRule" Type="System.Data.Rule" />
221 <remarks>To be added.</remarks>
223 <attribution license="cc4" from="Microsoft" modified="false" />
224 <para>This constructor is provided for design time support in the Visual Studio environment. <see cref="T:System.Data.ForeignKeyConstraint" /> objects created by using this constructor must then be added to the collection via <see cref="M:System.Data.ConstraintCollection.AddRange(System.Data.Constraint[])" />. Tables and columns with the specified names must exist at the time the method is called, or if <see cref="M:System.Data.DataTable.BeginInit" /> has been called prior to calling this constructor, the tables and columns with the specified names must exist at the time that <see cref="M:System.Data.DataTable.EndInit" /> is called.</para>
226 <param name="constraintName">
227 <attribution license="cc4" from="Microsoft" modified="false" />The name of the constraint. </param>
228 <param name="parentTableName">
229 <attribution license="cc4" from="Microsoft" modified="false" />The name of the parent <see cref="T:System.Data.DataTable" /> that contains parent <see cref="T:System.Data.DataColumn" /> objects in the constraint. </param>
230 <param name="parentTableNamespace">
231 <attribution license="cc4" from="Microsoft" modified="false" />The name of the <see cref="P:System.Data.DataTable.Namespace" />. </param>
232 <param name="parentColumnNames">
233 <attribution license="cc4" from="Microsoft" modified="false" />An array of the names of parent <see cref="T:System.Data.DataColumn" /> objects in the constraint. </param>
234 <param name="childColumnNames">
235 <attribution license="cc4" from="Microsoft" modified="false" />An array of the names of child <see cref="T:System.Data.DataColumn" /> objects in the constraint. </param>
236 <param name="acceptRejectRule">
237 <attribution license="cc4" from="Microsoft" modified="false" />One of the <see cref="T:System.Data.AcceptRejectRule" /> values. Possible values include None, Cascade, and Default. </param>
238 <param name="deleteRule">
239 <attribution license="cc4" from="Microsoft" modified="false" />One of the <see cref="T:System.Data.Rule" /> values to use when a row is deleted. The default is Cascade. Possible values include: None, Cascade, SetNull, SetDefault, and Default. </param>
240 <param name="updateRule">
241 <attribution license="cc4" from="Microsoft" modified="false" />One of the <see cref="T:System.Data.Rule" /> values to use when a row is updated. The default is Cascade. Possible values include: None, Cascade, SetNull, SetDefault, and Default. </param>
244 <Member MemberName="AcceptRejectRule">
245 <MemberSignature Language="C#" Value="public virtual System.Data.AcceptRejectRule AcceptRejectRule { set; get; }" />
246 <MemberType>Property</MemberType>
248 <ReturnType>System.Data.AcceptRejectRule</ReturnType>
253 <value>To be added: an object of type 'AcceptRejectRule'</value>
255 <attribution license="cc4" from="Microsoft" modified="false" />
256 <para>Changes to a <see cref="T:System.Data.DataRow" /> or <see cref="T:System.Data.DataTable" /> are not final until the AcceptChanges method is invoked. At that point, the <see cref="P:System.Data.ForeignKeyConstraint.AcceptRejectRule" /> determines the course of action on any values that have been changed or deleted.</para>
259 <attribution license="cc4" from="Microsoft" modified="false" />
260 <para>Indicates the action that should take place across this constraint when <see cref="M:System.Data.DataTable.AcceptChanges" /> is invoked.</para>
264 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
265 <AssemblyVersion>2.0.0.0</AssemblyVersion>
269 <AttributeName>System.ComponentModel.DefaultValue(System.Data.AcceptRejectRule.None)</AttributeName>
273 <Member MemberName="Columns">
274 <MemberSignature Language="C#" Value="public virtual System.Data.DataColumn[] Columns { get; }" />
275 <MemberType>Property</MemberType>
277 <ReturnType>System.Data.DataColumn[]</ReturnType>
280 <value>To be added: an object of type 'DataColumn []'</value>
281 <remarks>To be added</remarks>
283 <attribution license="cc4" from="Microsoft" modified="false" />
284 <para>Gets the child columns of this constraint.</para>
288 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
289 <AssemblyVersion>2.0.0.0</AssemblyVersion>
293 <AttributeName>System.ComponentModel.ReadOnly(true)</AttributeName>
297 <Member MemberName="DeleteRule">
298 <MemberSignature Language="C#" Value="public virtual System.Data.Rule DeleteRule { set; get; }" />
299 <MemberType>Property</MemberType>
301 <ReturnType>System.Data.Rule</ReturnType>
306 <value>To be added: an object of type 'Rule'</value>
308 <attribution license="cc4" from="Microsoft" modified="false" />
309 <para>When a row is deleted from a parent table, the <see cref="P:System.Data.ForeignKeyConstraint.DeleteRule" /> determines what will happen in the columns of the child table (or tables). If the rule is set to Cascade, child rows will be deleted.</para>
310 <para>If set to SetNull, a DBnull will be placed in the appropriate columns of the affected rows. Depending on your data source, a null value may or may not be permitted in a column. For example, SQLServer allows multiple null values to be found in a primary key column, even if they are not unique. In a <see cref="T:System.Data.DataTable" />, however, if a <see cref="T:System.Data.DataColumn" /> object's <see cref="P:System.Data.DataColumn.Unique" /> property is set to true, multiple null values are not allowed in primary key columns.</para>
311 <para>If set to SetDefault, the default value for the column is assigned.</para>
314 <attribution license="cc4" from="Microsoft" modified="false" />
315 <para>Gets or sets the action that occurs across this constraint when a row is deleted.</para>
319 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
320 <AssemblyVersion>2.0.0.0</AssemblyVersion>
324 <AttributeName>System.ComponentModel.DefaultValue(System.Data.Rule.Cascade)</AttributeName>
328 <Member MemberName="Equals">
329 <MemberSignature Language="C#" Value="public override bool Equals (object key);" />
330 <MemberType>Method</MemberType>
332 <ReturnType>System.Boolean</ReturnType>
335 <Parameter Name="key" Type="System.Object" />
338 <returns>To be added: an object of type 'bool'</returns>
339 <remarks>To be added</remarks>
341 <attribution license="cc4" from="Microsoft" modified="false" />
342 <para>Gets a value indicating whether the current <see cref="T:System.Data.ForeignKeyConstraint" /> is identical to the specified object.</para>
345 <attribution license="cc4" from="Microsoft" modified="false" />The object to which this <see cref="T:System.Data.ForeignKeyConstraint" /> is compared. Two <see cref="T:System.Data.ForeignKeyConstraint" /> are equal if they constrain the same columns. </param>
348 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
349 <AssemblyVersion>2.0.0.0</AssemblyVersion>
352 <Member MemberName="GetHashCode">
353 <MemberSignature Language="C#" Value="public override int GetHashCode ();" />
354 <MemberType>Method</MemberType>
356 <ReturnType>System.Int32</ReturnType>
360 <returns>To be added: an object of type 'int'</returns>
361 <remarks>To be added</remarks>
363 <attribution license="cc4" from="Microsoft" modified="false" />
364 <para>Gets the hash code of this instance of the <see cref="T:System.Data.ForeignKeyConstraint" /> object.</para>
368 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
369 <AssemblyVersion>2.0.0.0</AssemblyVersion>
372 <Member MemberName="RelatedColumns">
373 <MemberSignature Language="C#" Value="public virtual System.Data.DataColumn[] RelatedColumns { get; }" />
374 <MemberType>Property</MemberType>
376 <ReturnType>System.Data.DataColumn[]</ReturnType>
379 <value>To be added: an object of type 'DataColumn []'</value>
380 <remarks>To be added</remarks>
382 <attribution license="cc4" from="Microsoft" modified="false" />
383 <para>The parent columns of this constraint.</para>
387 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
388 <AssemblyVersion>2.0.0.0</AssemblyVersion>
392 <AttributeName>System.ComponentModel.ReadOnly(true)</AttributeName>
396 <Member MemberName="RelatedTable">
397 <MemberSignature Language="C#" Value="public virtual System.Data.DataTable RelatedTable { get; }" />
398 <MemberType>Property</MemberType>
400 <ReturnType>System.Data.DataTable</ReturnType>
403 <value>To be added: an object of type 'DataTable'</value>
404 <remarks>To be added</remarks>
406 <attribution license="cc4" from="Microsoft" modified="false" />
407 <para>Gets the parent table of this constraint.</para>
411 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
412 <AssemblyVersion>2.0.0.0</AssemblyVersion>
416 <AttributeName>System.ComponentModel.ReadOnly(true)</AttributeName>
420 <Member MemberName="Table">
421 <MemberSignature Language="C#" Value="public override System.Data.DataTable Table { get; }" />
422 <MemberType>Property</MemberType>
424 <ReturnType>System.Data.DataTable</ReturnType>
427 <value>To be added: an object of type 'DataTable'</value>
428 <remarks>To be added</remarks>
430 <attribution license="cc4" from="Microsoft" modified="false" />
431 <para>Gets the child table of this constraint.</para>
435 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
436 <AssemblyVersion>2.0.0.0</AssemblyVersion>
440 <AttributeName>System.ComponentModel.ReadOnly(true)</AttributeName>
444 <Member MemberName="UpdateRule">
445 <MemberSignature Language="C#" Value="public virtual System.Data.Rule UpdateRule { set; get; }" />
446 <MemberType>Property</MemberType>
448 <ReturnType>System.Data.Rule</ReturnType>
453 <value>To be added: an object of type 'Rule'</value>
454 <remarks>To be added</remarks>
456 <attribution license="cc4" from="Microsoft" modified="false" />
457 <para>Gets or sets the action that occurs across this constraint on when a row is updated.</para>
461 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
462 <AssemblyVersion>2.0.0.0</AssemblyVersion>
466 <AttributeName>System.ComponentModel.DefaultValue(System.Data.Rule.Cascade)</AttributeName>