Share via


DataSourceView.ExecuteUpdate(IDictionary, IDictionary, IDictionary) 메서드

정의

DataSourceView 개체가 나타내는 데이터 목록에서 업데이트 작업을 수행합니다.

protected:
 virtual int ExecuteUpdate(System::Collections::IDictionary ^ keys, System::Collections::IDictionary ^ values, System::Collections::IDictionary ^ oldValues);
protected virtual int ExecuteUpdate (System.Collections.IDictionary keys, System.Collections.IDictionary values, System.Collections.IDictionary oldValues);
abstract member ExecuteUpdate : System.Collections.IDictionary * System.Collections.IDictionary * System.Collections.IDictionary -> int
override this.ExecuteUpdate : System.Collections.IDictionary * System.Collections.IDictionary * System.Collections.IDictionary -> int
Protected Overridable Function ExecuteUpdate (keys As IDictionary, values As IDictionary, oldValues As IDictionary) As Integer

매개 변수

keys
IDictionary

업데이트 작업으로 업데이트할 개체 또는 행 키의 IDictionary입니다.

values
IDictionary

데이터 요소와 새 값을 나타내는 이름/값 쌍의 IDictionary입니다.

oldValues
IDictionary

데이터 요소와 원래 값을 나타내는 이름/값 쌍의 IDictionary입니다.

반환

내부 데이터 스토리지에서 업데이트된 항목의 수입니다.

예외

예제

다음 코드 예제에서는 방법을 확장 하는 클래스를 DataSourceView 클래스에서 재정의할 수는 CanUpdate 속성 및 ExecuteUpdate 메서드. 이 코드 예제는에 대해 제공 된 큰 예제의 일부는 DataSourceView 클래스입니다.

// The CsvDataSourceView does not currently
// permit update operations. You can modify or
// extend this sample to do so.
public override bool CanUpdate {
    get {
        return false;
    }
}
protected override int ExecuteUpdate(IDictionary keys, IDictionary values, IDictionary oldValues)
{
    throw new NotSupportedException();
}
   ' The CsvDataSourceView does not currently
   ' permit update operations. You can modify or
   ' extend this sample to do so.
   Public Overrides ReadOnly Property CanUpdate() As Boolean
      Get
         Return False
      End Get
   End Property

   Protected Overrides Function ExecuteUpdate(keys As IDictionary, _
                                              values As IDictionary, _
                                              oldValues As IDictionary) As Integer
      Throw New NotSupportedException()
   End Function 'ExecuteUpdate

End Class

설명

데이터 바인딩된 컨트롤을 확인할 수 있습니다 있는지 여부를 ExecuteUpdate 작업은 사용 하 여 데이터 소스 컨트롤에서 지원를 DataSourceControl.GetView 검색 하는 메서드를 DataSourceView 개체의 값을 확인 하 고를 CanUpdate 속성.

keys 매개 변수는 업데이트할 데이터의 개체 또는 행 키를 나타냅니다. 와 같은 관계형 데이터를 나타내는 데이터 원본에 대 한는 SqlDataSource 컨트롤을 keys 매개 변수는 데이터베이스 기본 키의 컬렉션입니다. 다른 시나리오의 경우에 keys 매개 변수 이름/값 쌍의 컬렉션 이며 데이터의 목록을 필터링 하는 데 사용 됩니다. 이름/값 쌍을 일치 하는 모든 데이터에 있는 값으로 업데이트 됩니다는 values 매개 변수는 기존 필드 또는 열에 대 한 새 값을 나타내는 이름/값 쌍의 집합입니다.

참고

합니다 DataSourceView 클래스의 기본 구현은 throw 하는 것을 NotSupportedException 예외입니다. DataSourceView 클래스를 확장할 때 클래스가 기본 스토리지에 데이터를 업데이트할 수 있는 경우 ExecuteUpdate 메서드를 재정의합니다.

적용 대상

추가 정보