Objectdatasource updating event args

If an exception occurred while updating, the event args contain an Exception object.

All you need to do is test that the Exception object is not null and then insert whatever code you want there.

When the In this example, the `Update Employee Info` method is used to perform an insert; however, it requires a `Northwind Employee` parameter to insert the data.

event, you can examine and manipulate the values of the parameters and perform any additional preprocessing that is required.

Any changes to the parameters in this dictionary will affect which method overload is called for the operation.

say two users are looking at the same form and one updates a few fields. Input Parameters, add a property my business object to handle my output parameter, and add my business object to e. Or do I just need to add a property to my business object to handle the output parameter and add that field to Object Data Source Method Event Args.

When the second user tries to update a record that's changed since the formview loaded, I use the integer returned from my updatemethod to determine the error message to display regarding the concurrency check.

The `Update Employee Info` method is not completely implemented, so you will not insert data into the Northwind Traders database when you experiment with this example.

I want to initialise my object to load all the old values from the object (rather than a blank object as Object Data Source defaults to). At present I have a kludge to get the data from the Details View control directly - is this the right method?

If you want to influence the creation of the object which should be defined by the dataobjecttypename property then you'll have to process the On XXX event.

in other words, when you do that you're influencing the creation of the object on which the methods defined by the XXXmethod properties are executed.

But I need to check to see if the update failed in the on Updated event handler, and it doesn't have e. So I need to know how to get a Grid View row to remain in edit mode if the update fails.

Tags: , ,