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

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

DataRowCollection.Remove メソッド

指定した DataRowコレクションから削除します

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

Public Sub Remove ( _
    row As DataRow _
)
Dim instance As DataRowCollection
Dim row As DataRow

instance.Remove(row)
public void Remove (
    DataRow row
)
public:
void Remove (
    DataRow^ row
)
public void Remove (
    DataRow row
)

パラメータ

row

削除する DataRow。

解説解説

行を削除すると、その行にあるすべてのデータ失われます。DataRow クラスDelete メソッド呼び出すと、行に削除マークだけを付けることができますRemove呼び出すことは、Delete呼び出してから AcceptChanges を呼び出すことと同等です。

Clear メソッド使用してコレクションすべてのメンバ一度削除することもできます

使用例使用例

Remove メソッド使用して、DataRowCollection オブジェクト内で見つかった行を削除する例を次に示します。この例では、最初に Contains メソッド使用して、この行コレクションに行が格納されているかどうか判断します。行が格納されている場合は、Find メソッド使用して特定の行を検索した後、Remove メソッド使用してその行を削除します

Private Sub RemoveFoundRow(ByVal
 table As DataTable)
    Dim rowCollection As DataRowCollection
 = table.Rows

    ' Test to see if the collection contains the value.
    If rowCollection.Contains(TextBox1.Text) Then
        Dim foundRow As DataRow = rowCollection.Find(TextBox1.Text)
        rowCollection.Remove(foundRow)
        Console.WriteLine("Row Deleted")
    Else
        Console.WriteLine("No such row found.")
    End If
 End Sub
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
DataRowCollection クラス
DataRowCollection メンバ
System.Data 名前空間
Add
Clear
Contains
Find



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

辞書ショートカット

すべての辞書の索引

「DataRowCollection.Remove メソッド」の関連用語

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

   

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



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

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

©2025 GRAS Group, Inc.RSS