ObjectDataSourceView.Update(IDictionary, IDictionary, IDictionary) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
透過呼叫由屬性UpdateMethod識別的方法,並使用集合中提供的keysvaluesoldValues參數,執行更新操作。
public:
int Update(System::Collections::IDictionary ^ keys, System::Collections::IDictionary ^ values, System::Collections::IDictionary ^ oldValues);
public int Update(System.Collections.IDictionary keys, System.Collections.IDictionary values, System.Collections.IDictionary oldValues);
override this.Update : System.Collections.IDictionary * System.Collections.IDictionary * System.Collections.IDictionary -> int
Public Function Update (keys As IDictionary, values As IDictionary, oldValues As IDictionary) As Integer
參數
- keys
- IDictionary
IDictionary A是用來識別要更新項目的關鍵值之一。 這些參數會依照屬性 UpdateMethod 指定的方法執行更新操作。 若方法無參數,則傳遞 null。
- values
- IDictionary
IDictionary A,這些新值將應用於資料來源。 這些參數會依照屬性 UpdateMethod 指定的方法來執行更新資料庫操作。 若方法無參數,則傳遞 null。
- oldValues
- IDictionary
IDictionary A 包含用於匹配資料來源項目的額外非鍵值。 只有當該 ConflictDetection 屬性設為欄位時 CompareAllValues ,列值才會傳遞給刪除方法。
傳回
更新的行數;否則,若未知數值,則為 -1。
備註
預設回傳值為 -1,表示有未知數量的列被更新。 若要回傳不同的值,請設定AffectedRows事件物件Updated的ObjectDataSourceStatusEventArgs屬性。 受影響的資料列數通常由Update該商業物件的方法回傳,該值可從ReturnValue事件參數Updated的屬性ObjectDataSourceStatusEventArgs中取得。
該 Update 方法呼叫 , ExecuteUpdate 傳遞 keys、 values和 oldValues 參數。