LinqDataSourceStatusEventArgs Class
Provides data for the ContextCreated, Deleted, Inserted, Selected, and Updated events.
Assembly: System.Web.Extensions (in System.Web.Extensions.dll)
The LinqDataSourceStatusEventArgs class enables you to examine the results of data operations that have been performed by a LinqDataSource control. A LinqDataSourceStatusEventArgs object is passed to event handlers for the ContextCreated, Deleted, Inserted, Selected, and Updated events of the LinqDataSource control.
If the data operation completed successfully, the resulting data object is stored in the Result property and the Exception property is nullptr. If the data operation failed, the exception that occurred during the data operation is stored in the Exception property and the Result property is nullptr. If you handled the exception represented by the Exception property, set the ExceptionHandled property to true so that the exception will not be thrown.
You retrieve the total number of data records returned from a query through the TotalRowCount property.
The following example shows an event handler for the Inserted event. In the event handler, if the Exception property is nullptr, the product ID is retrieved from the object in the Result property. The product ID is a primary key for the table and is set by the database, therefore the value is not known until the insert operation has finished. The exception message is logged if the Exception property is not equal to nullptr. The ExceptionHandled property is then set to true.
- AspNetHostingPermission
for operating in a hosted environment. Demand value: LinkDemand; Permission value: Minimal.
- AspNetHostingPermission
for operating in a hosted environment. Demand value: InheritanceDemand; Permission value: Minimal.
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.