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) メンバはすべて、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

VersionNotFoundException コンストラクタ ()


VersionNotFoundException コンストラクタ (String)


VersionNotFoundException コンストラクタ (String, Exception)

メモ : このコンストラクタは、.NET Framework version 2.0 で新しく追加されたものです。

指定したエラー メッセージと、この例外の原因である内部例外への参照を使用して、VersionNotFoundException クラスの新しいインスタンスを初期化します。

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

Public Sub New ( _
    message As String, _
    innerException As Exception _
)
Dim message As String
Dim innerException As Exception

Dim instance As New VersionNotFoundException(message,
 innerException)
public VersionNotFoundException (
    string message,
    Exception innerException
)
public:
VersionNotFoundException (
    String^ message, 
    Exception^ innerException
)
public VersionNotFoundException (
    String message, 
    Exception innerException
)
public function VersionNotFoundException (
    message : String, 
    innerException : Exception
)

パラメータ

message

例外の原因を説明するエラー メッセージ。

innerException

現在の例外の原因である例外。内部例外が指定されていない場合は null 参照 (Visual Basic では、Nothing)。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
VersionNotFoundException クラス
VersionNotFoundException メンバ
System.Data 名前空間

VersionNotFoundException コンストラクタ (SerializationInfo, StreamingContext)

シリアル化情報を指定して、VersionNotFoundException クラスの新しいインスタンスを初期化します。

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

Protected Sub New ( _
    info As SerializationInfo, _
    context As StreamingContext _
)
Dim info As SerializationInfo
Dim context As StreamingContext

Dim instance As New VersionNotFoundException(info,
 context)
protected VersionNotFoundException (
    SerializationInfo info,
    StreamingContext context
)
protected:
VersionNotFoundException (
    SerializationInfo^ info, 
    StreamingContext context
)
protected VersionNotFoundException (
    SerializationInfo info, 
    StreamingContext context
)
protected function VersionNotFoundException
 (
    info : SerializationInfo, 
    context : StreamingContext
)

パラメータ

info

オブジェクトのシリアル化または逆シリアル化に必要なデータ。

context

指定したシリアル化ストリームの転送元と転送先の説明。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
VersionNotFoundException クラス
VersionNotFoundException メンバ
System.Data 名前空間
StreamingContext
SerializationInfo

VersionNotFoundException コンストラクタ

VersionNotFoundException クラスの新しいインスタンスを初期化します。
オーバーロードの一覧オーバーロードの一覧

名前 説明
VersionNotFoundException () VersionNotFoundException クラスの新しいインスタンスを初期化します。

.NET Compact Framework によってサポートされています。

VersionNotFoundException (String) 文字列を指定して、VersionNotFoundException クラスの新しいインスタンスを初期化します。

.NET Compact Framework によってサポートされています。

VersionNotFoundException (SerializationInfo, StreamingContext) シリアル化情報を指定して、VersionNotFoundException クラスの新しいインスタンスを初期化します。
VersionNotFoundException (String, Exception) 指定したエラー メッセージと、この例外の原因である内部例外への参照を使用して、VersionNotFoundException クラスの新しいインスタンスを初期化します。

.NET Compact Framework によってサポートされています。

参照参照

関連項目

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

VersionNotFoundException プロパティ


VersionNotFoundException メソッド


パブリック メソッドパブリック メソッド

プロテクト メソッドプロテクト メソッド
参照参照

関連項目

VersionNotFoundException クラス
System.Data 名前空間

VersionNotFoundException メンバ

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

VersionNotFoundException データ型で公開されるメンバを以下の表に示します。


パブリック コンストラクタパブリック コンストラクタ
プロテクト コンストラクタプロテクト コンストラクタ
  名前 説明
プロテクト メソッド VersionNotFoundException オーバーロードされます。 VersionNotFoundException クラスの新しいインスタンスを初期化します。
パブリック プロパティパブリック プロパティ
プロテクト プロパティプロテクト プロパティ
  名前 説明
プロテクト プロパティ HResult  特定の例外に割り当てられているコード化数値である HRESULT を取得または設定します。(Exception から継承されます。)
パブリック メソッドパブリック メソッド
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

VersionNotFoundException クラス
System.Data 名前空間



英和和英テキスト翻訳

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

辞書ショートカット

すべての辞書の索引

「VersionNotFoundException」の関連用語

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

   

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



VersionNotFoundExceptionのページの著作権

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

©2026 GRAS Group, Inc.RSS