ConstraintCollection.Contains メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > ConstraintCollection.Contains メソッドの意味・解説 

ConstraintCollection.Contains メソッド

名前で指定した Constraint オブジェクトコレクション内に存在するかどうか示します

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

解説解説
使用例使用例

削除する前に指定した Constraint が ConstraintCollection に存在するかどうか確認する例を次に示します

Public Shared Sub RemoveConstraint(
 _
   constraints As ConstraintCollection, constraint As
 Constraint)
   Try
       If constraints.Contains(constraint.ConstraintName) Then
           If constraints.CanRemove(constraint)
               constraints.Remove(constraint.ConstraintName)
           End If
       End If

   Catch e As Exception
       ' Process exception and return.
       Console.WriteLine("Exception of type {0} occurred.",
 _
           e.GetType().ToString())
   End Try
End Sub
public static void RemoveConstraint(
    ConstraintCollection constraints, Constraint constraint)
{
    try
    {
        if(constraints.Contains(constraint.ConstraintName)) 
        {
            if(constraints.CanRemove(constraint)) 
            {
                constraints.Remove(constraint.ConstraintName);
            }
        }
    }
    catch(Exception e) 
    {
        // Process exception and return.
        Console.WriteLine("Exception of type {0} occurred.", 
            e.GetType());
    }
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
ConstraintCollection クラス
ConstraintCollection メンバ
System.Data 名前空間
Remove



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

ConstraintCollection.Contains メソッドのお隣キーワード
検索ランキング

   

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



ConstraintCollection.Contains メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS