VersionNotFoundException クラス

定義

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

public ref class VersionNotFoundException : System::Data::DataException
public class VersionNotFoundException : System.Data.DataException
[System.Serializable]
public class VersionNotFoundException : System.Data.DataException
type VersionNotFoundException = class
    inherit DataException
[<System.Serializable>]
type VersionNotFoundException = class
    inherit DataException
Public Class VersionNotFoundException
Inherits DataException
継承
VersionNotFoundException
属性

次の例では、 オブジェクトが DataTable 10 個と 10 DataRowDataColumnの を作成します。 を削除した DataRow後、削除された行の現在のバージョンを返そうとすると、例外が VersionNotFoundException スローされます。

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.");
    }
}
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

コンストラクター

VersionNotFoundException()

VersionNotFoundException クラスの新しいインスタンスを初期化します。

VersionNotFoundException(SerializationInfo, StreamingContext)

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

VersionNotFoundException(String)

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

VersionNotFoundException(String, Exception)

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

プロパティ

Data

例外に関する追加のユーザー定義情報を提供する、キーと値のペアのコレクションを取得します。

(継承元 Exception)
HelpLink

この例外に関連付けられているヘルプ ファイルへのリンクを取得または設定します。

(継承元 Exception)
HResult

特定の例外に割り当てられているコード化数値である HRESULT を取得または設定します。

(継承元 Exception)
InnerException

現在の例外の原因となる Exception インスタンスを取得します。

(継承元 Exception)
Message

現在の例外を説明するメッセージを取得します。

(継承元 Exception)
Source

エラーの原因となるアプリケーションまたはオブジェクトの名前を取得または設定します。

(継承元 Exception)
StackTrace

呼び出し履歴で直前のフレームの文字列形式を取得します。

(継承元 Exception)
TargetSite

現在の例外がスローされたメソッドを取得します。

(継承元 Exception)

メソッド

Equals(Object)

指定されたオブジェクトが現在のオブジェクトと等しいかどうかを判断します。

(継承元 Object)
GetBaseException()

派生クラスでオーバーライドされた場合、それ以後に発生する 1 つ以上の例外の根本原因である Exception を返します。

(継承元 Exception)
GetHashCode()

既定のハッシュ関数として機能します。

(継承元 Object)
GetObjectData(SerializationInfo, StreamingContext)

派生クラスでオーバーライドされた場合は、その例外に関する情報を使用して SerializationInfo を設定します。

(継承元 Exception)
GetType()

現在のインスタンスのランタイム型を取得します。

(継承元 Exception)
MemberwiseClone()

現在の Object の簡易コピーを作成します。

(継承元 Object)
ToString()

現在の例外の文字列形式を作成して返します。

(継承元 Exception)

イベント

SerializeObjectState
古い.

例外がシリアル化され、例外に関するシリアル化されたデータを含む例外状態オブジェクトが作成されたときに発生します。

(継承元 Exception)

適用対象