次の方法で共有


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 つ。使用できる値は、NoneCascade、および Default です。
  • deleteRule
    行が削除されたときに使用する Rule 値の 1 つ。既定値は Cascade です。使用できる値は、NoneCascadeSetNullSetDefaultDefault などです。
  • updateRule
    行が更新されたときに使用する Rule 値の 1 つ。既定値は Cascade です。使用できる値は、NoneCascadeSetNullSetDefaultDefault などです。

例外

例外の種類 条件

ArgumentNullException

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

InvalidConstraintException

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

または

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

プラットフォーム

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。

バージョン情報

.NET Framework

サポート対象 : 2.0、1.1、1.0

.NET Compact Framework

サポート対象 : 2.0、1.0

参照

関連項目

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