ForeignKeyConstraintとは? わかりやすく解説

ForeignKeyConstraint クラス

値または行を削除または更新したときに、主キーと外部キーのリレーションシップに関係する列セットに対して適用するアクション制約を表します。

名前空間: System.Data
アセンブリ: System.Data (system.data.dll 内)
構文構文

Public Class ForeignKeyConstraint
    Inherits Constraint
Dim instance As ForeignKeyConstraint
public class ForeignKeyConstraint : Constraint
public ref class ForeignKeyConstraint : public
 Constraint
public class ForeignKeyConstraint extends Constraint
public class ForeignKeyConstraint extends
 Constraint
解説解説

ForeignKeyConstraint は、列内の値を削除または更新したときに実行されるアクションを制限します。この制約は主キー列に使用する必要があります。2 つのテーブル間に親子のリレーションシップがある場合は、親テーブルから値を削除したときに、子行が次のいずれかの影響を受けることがあります。

ForeignKeyConstraint オブジェクトは DataTable の ConstraintCollection に格納されています。このコレクションにアクセスするには Constraints プロパティを使用します。

EnforceConstraints プロパティが true に設定されていない限り、制約は適用されません。

AcceptRejectRule は、DataTable オブジェクトの AcceptChanges メソッドが呼び出されるたびに適用されます。

使用例使用例

ForeignKeyConstraint を作成し、そのプロパティの一部を設定し、これを DataTable オブジェクトの ConstraintCollection に追加する例を次に示します。

' The next line goes into the Declarations section of the module:
' SuppliersProducts is a class derived from DataSet.
Private suppliersProducts As SuppliersProducts

Private Sub CreateConstraint()
    ' Declare parent column and child column variables.
    Dim parentColumn As DataColumn
    Dim childColumn As DataColumn
    Dim fkeyConstraint As ForeignKeyConstraint

    ' Set parent and child column variables.
    parentColumn = suppliersProducts.Tables("Suppliers").Columns("SupplierID")
    childColumn = suppliersProducts.Tables("Products").Columns("SupplierID")
    fkeyConstraint = New ForeignKeyConstraint( _
        "SupplierFKConstraint", parentColumn, childColumn)

    ' Set null values when a value is deleted.
    fkeyConstraint.DeleteRule = Rule.SetNull
    fkeyConstraint.UpdateRule = Rule.Cascade
    fkeyConstraint.AcceptRejectRule = AcceptRejectRule.Cascade

    ' Add the constraint, and set EnforceConstraints to true.
    suppliersProducts.Tables("Products").Constraints.Add(fkeyConstraint)
    suppliersProducts.EnforceConstraints = True
End Sub
継承階層継承階層
System.Object
   System.Data.Constraint
    System.Data.ForeignKeyConstraint
スレッド セーフスレッド セーフ
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
ForeignKeyConstraint メンバ
System.Data 名前空間
AcceptRejectRule 列挙体
DataTable クラス
ConstraintCollection クラス
Rule

ForeignKeyConstraint コンストラクタ (String, String, String[], String[], AcceptRejectRule, Rule, Rule)

このコンストラクタは、Visual Studio 環境でのデザイン時のサポートのために用意されています。このコンストラクタを使用して作成した ForeignKeyConstraint オブジェクトは、AddRange を使用してコレクションに追加する必要があります。このメソッドを呼び出したときに、指定した名前のテーブルと列が存在している必要があります。このコンストラクタを呼び出す前に BeginInit を呼び出した場合は、EndInit を呼び出したときに、指定した名前のテーブルと列が存在している必要があります。

名前空間: System.Data
アセンブリ: System.Data (system.data.dll 内)
構文構文

Public Sub New ( _
    constraintName As String, _
    parentTableName As String, _
    parentColumnNames As String(), _
    childColumnNames As String(), _
    acceptRejectRule As AcceptRejectRule, _
    deleteRule As Rule, _
    updateRule As Rule _
)
Dim constraintName As String
Dim parentTableName As String
Dim parentColumnNames As String()
Dim childColumnNames As String()
Dim acceptRejectRule As AcceptRejectRule
Dim deleteRule As Rule
Dim updateRule As Rule

Dim instance As New ForeignKeyConstraint(constraintName,
 parentTableName, parentColumnNames, childColumnNames, acceptRejectRule, deleteRule,
 updateRule)
public ForeignKeyConstraint (
    string constraintName,
    string parentTableName,
    string[] parentColumnNames,
    string[] childColumnNames,
    AcceptRejectRule acceptRejectRule,
    Rule deleteRule,
    Rule updateRule
)
public:
ForeignKeyConstraint (
    String^ constraintName, 
    String^ parentTableName, 
    array<String^>^ parentColumnNames, 
    array<String^>^ childColumnNames, 
    AcceptRejectRule acceptRejectRule, 
    Rule deleteRule, 
    Rule updateRule
)
public ForeignKeyConstraint (
    String constraintName, 
    String parentTableName, 
    String[] parentColumnNames, 
    String[] childColumnNames, 
    AcceptRejectRule acceptRejectRule, 
    Rule deleteRule, 
    Rule updateRule
)
public function ForeignKeyConstraint (
    constraintName : String, 
    parentTableName : String, 
    parentColumnNames : String[], 
    childColumnNames : String[], 
    acceptRejectRule : AcceptRejectRule, 
    deleteRule : Rule, 
    updateRule : Rule
)

パラメータ

constraintName

制約の名前。

parentTableName

制約内の親 DataColumn オブジェクトを格納している親 DataTable の名前。

parentColumnNames

制約内の親 DataColumn オブジェクトの名前の配列。

childColumnNames

制約内の子 DataColumn オブジェクトの名前の配列。

acceptRejectRule

AcceptRejectRule 値の 1 つ。使用できる値は、None、Cascade、および Default です。

deleteRule

行が削除されたときに使用する Rule 値の 1 つ。既定値は Cascade です。使用できる値は、None、Cascade、SetNull、SetDefault、Default などです。

updateRule

行が更新されたときに使用する Rule 値の 1 つ。既定値は Cascade です。使用できる値は、None、Cascade、SetNull、SetDefault、Default などです。

例外例外
例外の種類条件

ArgumentNullException

列の一方または両方が null 参照 (Visual Basic では Nothing) です。

InvalidConstraintException

列のデータ型が異なります。

または

テーブルが同じ DataSet に属していません。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
ForeignKeyConstraint クラス
ForeignKeyConstraint メンバ
System.Data 名前空間

ForeignKeyConstraint コンストラクタ (String, DataColumn[], DataColumn[])

名前と親子の DataColumn オブジェクトの配列を指定して、ForeignKeyConstraint クラスの新しいインスタンスを初期化します。

名前空間: System.Data
アセンブリ: System.Data (system.data.dll 内)
構文構文

Public Sub New ( _
    constraintName As String, _
    parentColumns As DataColumn(), _
    childColumns As DataColumn() _
)
Dim constraintName As String
Dim parentColumns As DataColumn()
Dim childColumns As DataColumn()

Dim instance As New ForeignKeyConstraint(constraintName,
 parentColumns, childColumns)
public ForeignKeyConstraint (
    string constraintName,
    DataColumn[] parentColumns,
    DataColumn[] childColumns
)
public:
ForeignKeyConstraint (
    String^ constraintName, 
    array<DataColumn^>^ parentColumns, 
    array<DataColumn^>^ childColumns
)
public ForeignKeyConstraint (
    String constraintName, 
    DataColumn[] parentColumns, 
    DataColumn[] childColumns
)
public function ForeignKeyConstraint (
    constraintName : String, 
    parentColumns : DataColumn[], 
    childColumns : DataColumn[]
)

パラメータ

constraintName

ForeignKeyConstraint の名前。null 参照 (Visual Basic では Nothing) または空の文字列の場合は、制約コレクションに追加したときに既定の名前が付けられます。

parentColumns

制約内の親 DataColumn の配列。

childColumns

制約内の子 DataColumn の配列。

例外例外
例外の種類条件

ArgumentNullException

列の一方または両方が null 参照 (Visual Basic では Nothing) です。

InvalidConstraintException

列のデータ型が異なります。

または

テーブルが同じ DataSet に属していません。

使用例使用例

新しい ForeignKeyConstraint を作成し、そのプロパティの一部を設定し、それを DataTable オブジェクトの ConstraintCollection に追加する例を次に示します。

Private Sub CreateConstraint(ByVal
 suppliersProducts As DataSet)
    ' Declare parent column and child column variables.
    Dim parentColumns(1) As DataColumn
    Dim childColumns(1) As DataColumn
    Dim fkConstraint As ForeignKeyConstraint

    ' Set parent and child column variables.
    parentColumns(0) = _
        suppliersProducts.Tables("OrderDetails").Columns("OrderID")
    parentColumns(1) = _
        suppliersProducts.Tables("OrderDetails").Columns("ProductID")
    childColumns(0) = _
        suppliersProducts.Tables("Sales").Columns("OrderID")
    childColumns(1) = _
        suppliersProducts.Tables("Sales").Columns("ProductID")
    fkConstraint = New ForeignKeyConstraint( _
        "ProductSalesOrders", parentColumns, childColumns)

    ' Set various properties of the constraint.
    With fkConstraint
        .DeleteRule = Rule.SetDefault
        .UpdateRule = Rule.Cascade
        .AcceptRejectRule = AcceptRejectRule.Cascade
    End With

    ' Add the constraint, and set EnforceConstraints to true.
    suppliersProducts.Tables("OrderDetails").Constraints.Add(
 _
        fkConstraint)
    suppliersProducts.EnforceConstraints = True
End Sub
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
ForeignKeyConstraint クラス
ForeignKeyConstraint メンバ
System.Data 名前空間

ForeignKeyConstraint コンストラクタ (String, DataColumn, DataColumn)

名前と親子の DataColumn オブジェクトを指定して、ForeignKeyConstraint クラスの新しいインスタンスを初期化します。

名前空間: System.Data
アセンブリ: System.Data (system.data.dll 内)
構文構文

Public Sub New ( _
    constraintName As String, _
    parentColumn As DataColumn, _
    childColumn As DataColumn _
)
Dim constraintName As String
Dim parentColumn As DataColumn
Dim childColumn As DataColumn

Dim instance As New ForeignKeyConstraint(constraintName,
 parentColumn, childColumn)
public ForeignKeyConstraint (
    string constraintName,
    DataColumn parentColumn,
    DataColumn childColumn
)
public:
ForeignKeyConstraint (
    String^ constraintName, 
    DataColumn^ parentColumn, 
    DataColumn^ childColumn
)
public ForeignKeyConstraint (
    String constraintName, 
    DataColumn parentColumn, 
    DataColumn childColumn
)
public function ForeignKeyConstraint (
    constraintName : String, 
    parentColumn : DataColumn, 
    childColumn : DataColumn
)

パラメータ

constraintName

制約の名前。

parentColumn

制約内の親 DataColumn。

childColumn

制約内の子 DataColumn。

例外例外
例外の種類条件

ArgumentNullException

列の一方または両方が null 参照 (Visual Basic では Nothing) です。

InvalidConstraintException

列のデータ型が異なります。

または

テーブルが同じ DataSet に属していません。

使用例使用例

新しい ForeignKeyConstraint を作成し、そのプロパティの一部を設定し、それを DataTable オブジェクトの ConstraintCollection に追加する例を次に示します。

' The next line goes into the Declarations section of the module:
   ' SuppliersProducts is a class derived from DataSet.
   Private suppliersProducts As SuppliersProducts

Private Sub CreateConstraint()
   ' Declare parent column and child column variables.
   Dim parentColumn As DataColumn
   Dim childColumn As DataColumn
   Dim fkeyConstraint As ForeignKeyConstraint

   ' Set parent and child column variables.
   parentColumn = _
       suppliersProducts.Tables("Suppliers").Columns("SupplierID")
   childColumn = _
       suppliersProducts.Tables("Products").Columns("SupplierID")
   fkeyConstraint = New ForeignKeyConstraint( _
       "SupplierFKConstraint", parentColumn, childColumn)

   ' Set various properties of the constraint.
   With fkeyConstraint
      .DeleteRule = Rule.SetNull
      .UpdateRule = Rule.Cascade
      .AcceptRejectRule = AcceptRejectRule.Cascade
   End With

   ' Add the constraint, and set EnforceConstraints to true.
   suppliersProducts.Tables("Products").Constraints.Add(fkeyConstraint)
   suppliersProducts.EnforceConstraints = True
End Sub
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
ForeignKeyConstraint クラス
ForeignKeyConstraint メンバ
System.Data 名前空間

ForeignKeyConstraint コンストラクタ (DataColumn[], DataColumn[])

親子の DataColumn オブジェクトの配列を指定して、ForeignKeyConstraint クラスの新しいインスタンスを初期化します。

名前空間: System.Data
アセンブリ: System.Data (system.data.dll 内)
構文構文

Public Sub New ( _
    parentColumns As DataColumn(), _
    childColumns As DataColumn() _
)
Dim parentColumns As DataColumn()
Dim childColumns As DataColumn()

Dim instance As New ForeignKeyConstraint(parentColumns,
 childColumns)
public ForeignKeyConstraint (
    DataColumn[] parentColumns,
    DataColumn[] childColumns
)
public:
ForeignKeyConstraint (
    array<DataColumn^>^ parentColumns, 
    array<DataColumn^>^ childColumns
)
public ForeignKeyConstraint (
    DataColumn[] parentColumns, 
    DataColumn[] childColumns
)
public function ForeignKeyConstraint (
    parentColumns : DataColumn[], 
    childColumns : DataColumn[]
)

パラメータ

parentColumns

制約内の親 DataColumn の配列。

childColumns

制約内の子 DataColumn の配列。

例外例外
例外の種類条件

ArgumentNullException

列の一方または両方が null 参照 (Visual Basic では Nothing) です。

InvalidConstraintException

列のデータ型が異なります。

または

テーブルが同じ DataSet に属していません。

使用例使用例

新しい ForeignKeyConstraint を作成し、そのプロパティの一部を設定し、それを DataTable オブジェクトの ConstraintCollection に追加する例を次に示します。

' The next line goes into the Declarations section.
' SuppliersProducts is a class derived from DataSet.
Private suppliersProducts As SuppliersProducts

Private Sub CreateConstraint()
   ' Declare parent column and child column variables.
   Dim parentColumns(1) As DataColumn
   Dim childColumns(1) As DataColumn
   Dim fkConstraint As ForeignKeyConstraint

   ' Set parent and child column variables.
   parentColumns(0) = _
       suppliersProducts.Tables("OrderDetails").Columns("OrderID")
   parentColumns(1) = _
       suppliersProducts.Tables("OrderDetails").Columns("ProductID")
   childColumns(0) = _
       suppliersProducts.Tables("Sales").Columns("OrderID")
   childColumns(1) = _
       suppliersProducts.Tables("Sales").Columns("ProductID")
   fkConstraint = _
       New ForeignKeyConstraint(parentColumns, childColumns)

   ' Set various properties of the constraint.
   With fkConstraint
      .ConstraintName = "ProductSalesOrders"
      .DeleteRule = Rule.SetDefault
      .UpdateRule = Rule.Cascade
      .AcceptRejectRule = AcceptRejectRule.Cascade
   End With

   ' Add the constraint, and set EnforceConstraints to true.
   suppliersProducts.Tables( _
       "OrderDetails").Constraints.Add(fkConstraint)
   suppliersProducts.EnforceConstraints = True
End Sub
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
ForeignKeyConstraint クラス
ForeignKeyConstraint メンバ
System.Data 名前空間

ForeignKeyConstraint コンストラクタ (String, String, String, String[], String[], AcceptRejectRule, Rule, Rule)

メモ : このコンストラクタは、.NET Framework version 2.0 で新しく追加されたものです。

このコンストラクタは、Visual Studio 環境でのデザイン時のサポートのために用意されています。このコンストラクタを使用して作成した ForeignKeyConstraint オブジェクトは、AddRange を使用してコレクションに追加する必要があります。このメソッドを呼び出したときに、指定した名前のテーブルと列が存在している必要があります。このコンストラクタを呼び出す前に BeginInit を呼び出した場合は、EndInit を呼び出したときに、指定した名前のテーブルと列が存在している必要があります。

名前空間: System.Data
アセンブリ: System.Data (system.data.dll 内)
構文構文

Public Sub New ( _
    constraintName As String, _
    parentTableName As String, _
    parentTableNamespace As String, _
    parentColumnNames As String(), _
    childColumnNames As String(), _
    acceptRejectRule As AcceptRejectRule, _
    deleteRule As Rule, _
    updateRule As Rule _
)
Dim constraintName As String
Dim parentTableName As String
Dim parentTableNamespace As String
Dim parentColumnNames As String()
Dim childColumnNames As String()
Dim acceptRejectRule As AcceptRejectRule
Dim deleteRule As Rule
Dim updateRule As Rule

Dim instance As New ForeignKeyConstraint(constraintName,
 parentTableName, parentTableNamespace, parentColumnNames, childColumnNames, acceptRejectRule,
 deleteRule, updateRule)
public ForeignKeyConstraint (
    string constraintName,
    string parentTableName,
    string parentTableNamespace,
    string[] parentColumnNames,
    string[] childColumnNames,
    AcceptRejectRule acceptRejectRule,
    Rule deleteRule,
    Rule updateRule
)
public:
ForeignKeyConstraint (
    String^ constraintName, 
    String^ parentTableName, 
    String^ parentTableNamespace, 
    array<String^>^ parentColumnNames, 
    array<String^>^ childColumnNames, 
    AcceptRejectRule acceptRejectRule, 
    Rule deleteRule, 
    Rule updateRule
)
public ForeignKeyConstraint (
    String constraintName, 
    String parentTableName, 
    String parentTableNamespace, 
    String[] parentColumnNames, 
    String[] childColumnNames, 
    AcceptRejectRule acceptRejectRule, 
    Rule deleteRule, 
    Rule updateRule
)
public function ForeignKeyConstraint (
    constraintName : String, 
    parentTableName : String, 
    parentTableNamespace : String, 
    parentColumnNames : String[], 
    childColumnNames : String[], 
    acceptRejectRule : AcceptRejectRule, 
    deleteRule : Rule, 
    updateRule : Rule
)

パラメータ

constraintName

制約の名前。

parentTableName

制約内の親 DataColumn オブジェクトを格納している親 DataTable の名前。

parentTableNamespace

Namespace の名前。

parentColumnNames

制約内の親 DataColumn オブジェクトの名前の配列。

childColumnNames

制約内の子 DataColumn オブジェクトの名前の配列。

acceptRejectRule

AcceptRejectRule 値の 1 つ。使用できる値は、None、Cascade、および Default です。

deleteRule

行が削除されたときに使用する Rule 値の 1 つ。既定値は Cascade です。使用できる値は、None、Cascade、SetNull、SetDefault、Default などです。

updateRule

行が更新されたときに使用する Rule 値の 1 つ。既定値は Cascade です。使用できる値は、None、Cascade、SetNull、SetDefault、Default などです。

例外例外
例外の種類条件

ArgumentNullException

列の一方または両方が null 参照 (Visual Basic では Nothing) です。

InvalidConstraintException

列のデータ型が異なります。

または

テーブルが同じ DataSet に属していません。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
ForeignKeyConstraint クラス
ForeignKeyConstraint メンバ
System.Data 名前空間

ForeignKeyConstraint コンストラクタ

ForeignKeyConstraint クラスの新しいインスタンスを初期化します。
オーバーロードの一覧オーバーロードの一覧

名前 説明
ForeignKeyConstraint (DataColumn, DataColumn) 親子の DataColumn オブジェクトを指定して、ForeignKeyConstraint クラスの新しいインスタンスを初期化します。

.NET Compact Framework によってサポートされています。

ForeignKeyConstraint (DataColumn[], DataColumn[]) 親子の DataColumn オブジェクトの配列を指定して、ForeignKeyConstraint クラスの新しいインスタンスを初期化します。

.NET Compact Framework によってサポートされています。

ForeignKeyConstraint (String, DataColumn, DataColumn) 名前と親子の DataColumn オブジェクトを指定して、ForeignKeyConstraint クラスの新しいインスタンスを初期化します。

.NET Compact Framework によってサポートされています。

ForeignKeyConstraint (String, DataColumn[], DataColumn[]) 名前と親子の DataColumn オブジェクトの配列を指定して、ForeignKeyConstraint クラスの新しいインスタンスを初期化します。

.NET Compact Framework によってサポートされています。

ForeignKeyConstraint (String, String, String[], String[], AcceptRejectRule, Rule, Rule) このコンストラクタは、Visual Studio 環境でのデザイン時のサポートのために用意されています。このコンストラクタを使用して作成した ForeignKeyConstraint オブジェクトは、AddRange を使用してコレクションに追加する必要があります。このメソッドを呼び出したときに、指定した名前のテーブルと列が存在している必要があります。このコンストラクタを呼び出す前に BeginInit を呼び出した場合は、EndInit を呼び出したときに、指定した名前のテーブルと列が存在している必要があります。

.NET Compact Framework によってサポートされています。

ForeignKeyConstraint (String, String, String, String[], String[], AcceptRejectRule, Rule, Rule) このコンストラクタは、Visual Studio 環境でのデザイン時のサポートのために用意されています。このコンストラクタを使用して作成した ForeignKeyConstraint オブジェクトは、AddRange を使用してコレクションに追加する必要があります。このメソッドを呼び出したときに、指定した名前のテーブルと列が存在している必要があります。このコンストラクタを呼び出す前に BeginInit を呼び出した場合は、EndInit を呼び出したときに、指定した名前のテーブルと列が存在している必要があります。

.NET Compact Framework によってサポートされています。

参照参照

関連項目

ForeignKeyConstraint クラス
ForeignKeyConstraint メンバ
System.Data 名前空間

ForeignKeyConstraint コンストラクタ (DataColumn, DataColumn)

親子の DataColumn オブジェクトを指定して、ForeignKeyConstraint クラスの新しいインスタンスを初期化します。

名前空間: System.Data
アセンブリ: System.Data (system.data.dll 内)
構文構文

Public Sub New ( _
    parentColumn As DataColumn, _
    childColumn As DataColumn _
)
Dim parentColumn As DataColumn
Dim childColumn As DataColumn

Dim instance As New ForeignKeyConstraint(parentColumn,
 childColumn)
public ForeignKeyConstraint (
    DataColumn parentColumn,
    DataColumn childColumn
)
public:
ForeignKeyConstraint (
    DataColumn^ parentColumn, 
    DataColumn^ childColumn
)
public ForeignKeyConstraint (
    DataColumn parentColumn, 
    DataColumn childColumn
)
public function ForeignKeyConstraint (
    parentColumn : DataColumn, 
    childColumn : DataColumn
)

パラメータ

parentColumn

制約内の親 DataColumn。

childColumn

制約内の子 DataColumn。

例外例外
例外の種類条件

ArgumentNullException

列の一方または両方が null 参照 (Visual Basic では Nothing) です。

InvalidConstraintException

列のデータ型が異なります。

または

テーブルが同じ DataSet に属していません。

使用例使用例

新しい ForeignKeyConstraint を作成し、そのプロパティの一部を設定し、それを DataTable オブジェクトの ConstraintCollection に追加する例を次に示します。

' The next line goes into the Declarations section.
' SuppliersProducts is a class derived from DataSet.
Private suppliersProducts As SuppliersProducts
 
 
Private Sub CreateConstraint()
   ' Declare parent column and child column variables.
   Dim parentColumn As DataColumn
   Dim childColumn As DataColumn
   Dim fkConstraint As ForeignKeyConstraint

   ' Set parent and child column variables.
   parentColumn = _
       suppliersProducts.Tables("Suppliers").Columns("SupplierID")
   childColumn = _
       suppliersProducts.Tables("Products").Columns("SupplieriD")
   fkConstraint = New ForeignKeyConstraint(parentColumn, childColumn)

   ' Set various properties of the constraint.
   With fkConstraint
      .ConstraintName = "suppierFKConstraint"
      .DeleteRule = Rule.SetNull
      .UpdateRule = Rule.Cascade
      .AcceptRejectRule = AcceptRejectRule.Cascade
   End With

   ' Add the constraint, and set EnforceConstraints to true.
   suppliersProducts.Tables("Products").Constraints.Add(fkConstraint)
   suppliersProducts.EnforceConstraints = True
End Sub
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
ForeignKeyConstraint クラス
ForeignKeyConstraint メンバ
System.Data 名前空間

ForeignKeyConstraint プロパティ


パブリック プロパティパブリック プロパティ

( プロテクト プロパティ も参照)
  名前 説明
パブリック プロパティ ConstraintName  ConstraintCollection 内の制約の名前。 ( Constraint から継承されます。)
パブリック プロパティ ExtendedProperties  ユーザー定義の制約のプロパティのコレクションを取得します。 ( Constraint から継承されます。)
パブリック プロパティ UpdateRule 行を更新したときにこの制約全体で発生するアクションを取得または設定します。
プロテクト プロパティプロテクト プロパティ
  名前 説明
プロテクト プロパティ _DataSet  この制約が属する DataSet を取得します。 ( Constraint から継承されます。)
参照参照

関連項目

ForeignKeyConstraint クラス
System.Data 名前空間
AcceptRejectRule 列挙体
DataTable クラス
ConstraintCollection クラス
Rule

ForeignKeyConstraint メソッド


ForeignKeyConstraint メンバ

値または行を削除または更新したときに、主キーと外部キーのリレーションシップに関係する列セットに対して適用するアクション制約を表します。

ForeignKeyConstraint データ型で公開されるメンバを以下の表に示します。


パブリック コンストラクタパブリック コンストラクタ
  名前 説明
パブリック メソッド ForeignKeyConstraint オーバーロードされます。 ForeignKeyConstraint クラスの新しいインスタンスを初期化します。
パブリック プロパティパブリック プロパティ
( プロテクト プロパティ も参照)
  名前 説明
パブリック プロパティ ConstraintName  ConstraintCollection 内の制約の名前。(Constraint から継承されます。)
パブリック プロパティ ExtendedProperties  ユーザー定義の制約のプロパティのコレクションを取得します。(Constraint から継承されます。)
パブリック プロパティ UpdateRule 行を更新したときにこの制約全体で発生するアクションを取得または設定します。
プロテクト プロパティプロテクト プロパティ
  名前 説明
プロテクト プロパティ _DataSet  この制約が属する DataSet を取得します。(Constraint から継承されます。)
パブリック メソッドパブリック メソッド
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

ForeignKeyConstraint クラス
System.Data 名前空間
AcceptRejectRule 列挙体
DataTable クラス
ConstraintCollection クラス
Rule



英和和英テキスト翻訳

英語⇒日本語日本語⇒英語

辞書ショートカット

すべての辞書の索引

「ForeignKeyConstraint」の関連用語

ForeignKeyConstraintのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



ForeignKeyConstraintのページの著作権

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2026 Microsoft.All rights reserved.

©2026 GRAS Group, Inc.RSS