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

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

VersionNotFoundException クラス

削除された DataRow のバージョン返そうとした場合スローされる例外表します

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

<SerializableAttribute> _
Public Class VersionNotFoundException
    Inherits DataException
Dim instance As VersionNotFoundException
[SerializableAttribute] 
public class VersionNotFoundException : DataException
[SerializableAttribute] 
public ref class VersionNotFoundException :
 public DataException
/** @attribute SerializableAttribute() */ 
public class VersionNotFoundException extends
 DataException
SerializableAttribute 
public class VersionNotFoundException extends
 DataException
使用例使用例

1 個の DataColumn オブジェクト10 個の DataRow オブジェクト使用して、DataTable を作成する例を次に示しますDataRow削除した後、削除した行の現在のバージョン返そうとすると、VersionNotFoundException 例外スローさます。

Private Sub DemonstrateVersionNotFoundException()
    ' Create a DataTable with one column.
    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
    table.AcceptChanges()

    Try
        Console.WriteLine("Trying...")
        Dim removedRow As DataRow = table.Rows(9)
        removedRow.Delete()
        removedRow.AcceptChanges()

        ' Try to get the Current row version.
        Console.WriteLine(removedRow(0, DataRowVersion.Current))
    
    Catch e As System.Data.VersionNotFoundException
        Console.WriteLine("Current version of row not found.")
    End Try
End Sub 
private void DemonstrateVersionNotFoundException()
{
    // Create a DataTable with one column.
    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);
    }
    table.AcceptChanges();

    try
    {
        Console.WriteLine("Trying...");
        DataRow removedRow = table.Rows[9];
        removedRow.Delete();
        removedRow.AcceptChanges();
        // Try to get the Current row version.
        Console.WriteLine(removedRow[0,DataRowVersion.Current]);
 
    }
    catch(System.Data.VersionNotFoundException)
    {
        Console.WriteLine("Current version of row not found.");
    }
}
継承階層継承階層
System.Object
   System.Exception
     System.SystemException
       System.Data.DataException
        System.Data.VersionNotFoundException
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



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

辞書ショートカット

すべての辞書の索引

「VersionNotFoundException クラス」の関連用語

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

   

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



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

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

©2025 GRAS Group, Inc.RSS