Gets or sets the name of the method or function that the ObjectDataSource control invokes to retrieve a row count.
Assembly: System.Web (in System.Web.dll)
The property identifies a business object method that is used to retrieve a total row count, to support data source paging. The property is evaluated only if the EnablePaging property is set to true.
The property delegates to the SelectCountMethod property of the ObjectDataSourceView object that is associated with the ObjectDataSource control. For information about how paging is supported by the ObjectDataSource control, see EnablePaging.
The following three examples show a Web page, a code-behind page class, and a data-access class that enable the user to pick how many records are displayed in the page.
The Web page contains an ObjectDataSource control whose EnablePaging property is set to true. The property is set to the name of a method that returns the total number of records in the query. The MaximumRowsParameterName property and the StartRowIndexParameterName property are set to the names of the parameters that are used in the Select method. The page also contains a DropDownList control.
The third example shows the data access class that retrieves data from the Customers table. It includes a method named GetSubsetOfEmployees, which is assigned to the SelectMethod property of the ObjectDataSource control. The example also includes a method named GetEmployeeCount, which is assigned to the property of the ObjectDataSource control. The class uses LINQ to query the Customers table. The example requires a LINQ to SQL class that represents the Northwind database and Customers table. For more information, see How to: Create LINQ to SQL Classes in a Web Project.