RowNotInTableException クラスとは? わかりやすく解説

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

RowNotInTableException クラス

DataTable 内に存在しない DataRow で操作実行しようとした場合スローされる例外表します

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

<SerializableAttribute> _
Public Class RowNotInTableException
    Inherits DataException
Dim instance As RowNotInTableException
[SerializableAttribute] 
public class RowNotInTableException : DataException
[SerializableAttribute] 
public ref class RowNotInTableException : public
 DataException
/** @attribute SerializableAttribute() */ 
public class RowNotInTableException extends
 DataException
SerializableAttribute 
public class RowNotInTableException extends
 DataException
解説解説

Delete メソッドまたは DataRowCollection.Remove メソッド使用して削除された行次のメソッド呼び出した場合は、RowNotInTableExceptionスローさます。

  • DataRow.AcceptChanges

  • DataRow.GetChildRows

  • DataRow.GetParentRow

  • DataRow.GetParentRows

  • DataRow.RejectChanges

  • DataRow.SetParentRow

使用例使用例

1 個の DataColumn オブジェクト10 個の DataRow オブジェクト使用してDataTable作成する例を次に示します。行を削除するAcceptChanges メソッド呼び出されRowNotInTableExceptionスローさます。

Private Sub DemonstrateRowNotInTableException()
    ' Create a DataTable with one column and ten rows.      
    Dim table As New DataTable("NewTable")
    Dim column As New DataColumn("NewColumn")
    table.Columns.Add(column)

    Dim newRow As DataRow
    Dim i As Integer
    For i = 0 To 9
        newRow = table.NewRow()
        newRow("NewColumn") = i
        table.Rows.Add(newRow)
    Next i

    Try
        ' Remove a row and invoke AcceptChanges.
        Dim removedRow As DataRow = table.Rows(9)
        removedRow.Delete()
        removedRow.AcceptChanges()
    
    Catch rowException As System.Data.RowNotInTableException
        Console.WriteLine("Row not in table")
    End Try
End Sub 
private void DemonstrateRowNotInTableException()
{
    // Create a DataTable with one column and ten rows.      
    DataTable table = new DataTable("NewTable");
    DataColumn column = new DataColumn("NewColumn");
    table.Columns.Add(column);

    DataRow newRow;
    for(int i = 0;i <10;i++)
    {
        newRow = table.NewRow();
        newRow["NewColumn"] = i;
        table.Rows.Add(newRow);
    }
    try
    {
        // Remove a row and invoke AcceptChanges.
        DataRow removedRow = table.Rows[9];
        removedRow.Delete();
        removedRow.AcceptChanges();
 
    }
    catch(System.Data.RowNotInTableException rowException)
    {
        Console.WriteLine("Row not in table");
    }
}
継承階層継承階層
System.Object
   System.Exception
     System.SystemException
       System.Data.DataException
        System.Data.RowNotInTableException
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



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

辞書ショートカット

すべての辞書の索引

「RowNotInTableException クラス」の関連用語

RowNotInTableException クラスのお隣キーワード
検索ランキング

   

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



RowNotInTableException クラスのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2024 GRAS Group, Inc.RSS