VersionNotFoundException クラス
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
削除された DataRow のバージョンを返そうとしたときにスローされる例外を表します。
public ref class VersionNotFoundException : System::Data::DataException
[System.Serializable]
public class VersionNotFoundException : System.Data.DataException
public class VersionNotFoundException : System.Data.DataException
[<System.Serializable>]
type VersionNotFoundException = class
inherit DataException
type VersionNotFoundException = class
inherit DataException
Public Class VersionNotFoundException
Inherits DataException
- 継承
- 属性
例
次の例では、1 つのDataColumnと 10 個のDataRow オブジェクトを含むDataTableを作成します。 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, Exception) |
指定したエラー メッセージと、この例外の原因である内部例外への参照を使用して、 VersionNotFoundException クラスの新しいインスタンスを初期化します。 |
| VersionNotFoundException(String) |
指定した文字列を使用して、 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) |