Occurs when a Select operation has completed.
Assembly: System.Web (in System.Web.dll)
Handle the event to examine the values of a return value or output parameters, or to determine whether an exception was thrown after a Select operation has completed. The return value, output parameters, and exception handling properties are available from the ObjectDataSourceStatusEventArgs object that is associated with the event.
For more information about handling events, see Consuming Events.
The following three examples show a Web page, a code-behind page class, and a data-access class that enable a user to retrieve and update records in the Employees table in the Northwind database.
The first example shows a Web page that contains two ObjectDataSource controls, a DropDownList control, and a DetailsView control. The first ObjectDataSource control and the DropDownList control are used to retrieve and display employee names from the database. The second ObjectDataSource control and the DetailsView control are used to retrieve, display, and modify the data from the employee record that is selected by the user.
The second example shows handlers for the and Updating events. The 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.
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.