The SelectMethod property delegates to the SelectMethod property of the ObjectDataSourceView object that is associated with the ObjectDataSource control.
The object is wrapped in a one-element IEnumerable collection and returned by the Select method. The first DataTable of the DataSet is extracted, and a DataView is created and returned by the Select method. The IEnumerable is returned by the Select method.Ī DataView is created using the DataTable and returned by the Select method.Ī DataView is returned by the Select method. The specified method can have any method signature, but it must return one of the types shown in the following table for the ObjectDataSource control to call it successfully. The GridView control enumerates through the IEnumerable collection that is returned by the method that is specified by the SelectMethod property, and displays the data. At run time, the object is created and the method is called using reflection. The ObjectDataSource identifies a partially or fully qualified class name with its TypeName property and a method that is called to retrieve data with its SelectMethod property.
INSERT USING OBJECTDATASOURCE WITH DUPLICACY CHECK CODE
The following code example demonstrates how a GridView control can display data using an ObjectDataSource control on a Web Forms page. Property System::String ^ SelectMethod member this.SelectMethod : string with get, set Public Property SelectMethod As String Property Value StringĪ string that represents the name of the method or function that the ObjectDataSource uses to retrieve data. Gets or sets the name of the method or function that the ObjectDataSource control invokes to retrieve data.