Handle the Updating event to perform additional initialization that is specific to your application, to validate the values of parameters, or to change the parameter values before the ObjectDataSource control performs the update operation. The parameters are available as an IDictionary collection that is accessed by the InputParameters property, which is exposed by the ObjectDataSourceMethodEventArgs object.

No code example is currently available or this language may not be supported.

The second example shows handlers for the Selected and Updating events. The Selected event handler serializes the object that contains data that was retrieved from the Employee table. The serialized object is stored in view state. The Updating event handler deserializes the object in view state that contains the original data for the data record that is being updated. The object that contains the original data is passed as a parameter to the Update method. The original data must be passed to the database so that it can be used to check whether the data has been modified by another process.

No code example is currently available or this language may not be supported.

The third example shows the data access class that interacts with the Northwind database. The class uses LINQ to query and update the Employees table. The example requires a LINQ to SQL class that represents the Northwind database and Employees table. For more information, see How to: Create LINQ to SQL Classes in a Web Project.