VersionNotFoundException 클래스

정의

삭제된 DataRow의 버전을 반환하려고 할 때 throw되는 예외를 나타냅니다.

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 1개와 10개 DataColumnDataRow 인 을 만듭니다. 를 삭제한 DataRow후 제거된 행의 현재 버전을 반환하려고 하면 예외가 VersionNotFoundException throw됩니다.

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)
사용되지 않음.

serialization 정보를 사용하여 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

현재 예외를 throw하는 메서드를 가져옵니다.

(다음에서 상속됨 Exception)

메서드

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetBaseException()

파생 클래스에서 재정의된 경우 하나 이상의 후속 예외의 근본 원인이 되는 Exception 을 반환합니다.

(다음에서 상속됨 Exception)
GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetObjectData(SerializationInfo, StreamingContext)
사용되지 않음.

파생 클래스에서 재정의된 경우 예외에 관한 정보를 SerializationInfo 에 설정합니다.

(다음에서 상속됨 Exception)
GetType()

현재 인스턴스의 런타임 형식을 가져옵니다.

(다음에서 상속됨 Exception)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ToString()

현재 예외에 대한 문자열 표현을 만들고 반환합니다.

(다음에서 상속됨 Exception)

이벤트

SerializeObjectState
사용되지 않음.

예외에 대한 serialize된 데이터가 들어 있는 예외 상태 개체가 만들어지도록 예외가 serialize될 때 발생합니다.

(다음에서 상속됨 Exception)

적용 대상