DB2DataAdapter.RowUpdated 事件

對資料庫執行指令之後,在 更新 作業期間發生。

名稱空間:
IBM.Data.DB2
組件:
IBM.Data.DB2 (在 IBM.Data.DB2.dll中)

語法


[Visual Basic]
Public Event RowUpdated As DB2RowUpdatedEventHandler
[C#]
public event DB2RowUpdatedEventHandler RowUpdated;
[C++]
public: __event DB2RowUpdatedEventHandler * RowUpdated;
[JScript]

在 JScript (R) 中,您可以處理類別所定義的事件,但無法宣告新事件。

事件資料

事件處理程式會接收類型為 DB2RowUpdatedEventArgs 的引數,其中包含與此事件相關的資料。 下列 DB2RowUpdatedEventArgs 內容提供此事件特有的資訊。

內容 說明
DB2®RowUpdatingEventArgs.Command 取得呼叫 Update 時執行的 DB2Command
錯誤 (繼承自 RowUpdatedEventArgs) 取得執行 指令 時 IBM® Data Server Provider for .NET 所產生的任何錯誤。
RecordsAffected (繼承自 RowUpdatedEventArgs) 取得執行 SQL 陳述式所變更、插入或刪除的列數。
(繼承自 RowUpdatedEventArgs) 取得透過 更新傳送的 DataRow
StatementType (繼承自 RowUpdatedEventArgs) 取得已執行的 SQL 陳述式類型。
狀態 (繼承自 RowUpdatedEventArgs) 取得 指令UpdateStatus
TableMapping (繼承自 RowUpdatedEventArgs) 取得透過 更新傳送的 DataTableMapping

備註

使用 更新 方法時,每個已更新資料列會發生兩個事件。 執行順序如下:
  1. DataRow 中的值會移至參數值。
  2. 引發 OnRowUpdating 事件。
  3. 指令執行。
  4. 如果 UpdateRowSource 列舉設為 FirstReturnedRecord,則會將第一個傳回的結果放置在 DataRow中。
  5. 如果有輸出參數,則會將它們放置在 DataRow中。
  6. 引發 OnRowUpdated 事件。
  7. 即會呼叫 AcceptChanges