Occurs after a query has been executed.
Assembly: System.Web.Entity (in System.Web.Entity.dll)
The event is raised after a query has been executed and data has been returned. It is also raised if an error occurred during query preparation or execution.
The Results property of the EntityDataSourceSelectedEventArgs object contains an IEnumerable of objects that are returned from the query. Handle the event to retrieve and store returned entities in the ViewState. Do this to persist object changes on the page.
The TotalRowCount property of the EntityDataSourceSelectedEventArgs object shows the total number of objects in all pages, regardless of the values passed by the data-bound control for paging. TotalRowCount is only retrieved if the data-bound control needs it, such as if paging is enabled.
If an error occurs when the query is prepared or executed, the event is raised, the Exception property of the EntityDataSourceSelectedEventArgs object is set to the returned Exception, and the Results property is set to Nothing. If you handle the exception in the event handler, set the ExceptionHandled property to true. This prevents the exception from being raised again. When you specify a value of false for the ExceptionHandled property, the EntityDataSource re-raises the exception.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2