Uredi

Deli z drugimi prek


ObjectDataSourceView.Update(IDictionary, IDictionary, IDictionary) Method

Definition

Performs an update operation by calling the method that is identified by the UpdateMethod property and using any parameters that are supplied in the keys, values, or oldValues collections.

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

Parameters

keys
IDictionary

A IDictionary of the key values used to identify the item to update. These parameters are used with the method specified by the UpdateMethod property to perform the update operation. If there are no parameters associated with the method, pass null.

values
IDictionary

A IDictionary of new values to apply to the data source. These parameters are used with the method specified by the UpdateMethod property to perform the update database operation. If there are no parameters associated with the method, pass null.

oldValues
IDictionary

A IDictionary that contains the additional non-key values used to match the item in the data source. Row values are passed to the delete method, only if the ConflictDetection property is set to the CompareAllValues field.

Returns

The number of rows updated; otherwise, -1, if the number is not known.

Remarks

The default return value is -1, which means that an unknown number of rows were updated. To return a different value, set the AffectedRows property of the ObjectDataSourceStatusEventArgs object of the Updated event. The number of affected rows is typically returned by the Update method for the business object, and that value is available from the ReturnValue property of the ObjectDataSourceStatusEventArgs parameter of the Updated event.

The Update method calls the ExecuteUpdate method, passing the keys, values, and oldValues parameters.

Applies to

See also