

In the wizard, this scenario corresponds to the “Retrieve the actual data” option. If the DataSource property has been assigned a type, the ObjectDataSource will try to create an instance of this type when calling the ObjectDataSource.Fill method (this will require specifying the constructor parameters, which is explained further in this article). In the wizard, this scenario corresponds to the “Retrieve the data source schema” option.
#INSERT USING OBJECTDATASOURCE WITH DUPLICACY CHECK CODE#
It can be assigned a specific object instance or a type.īecause the Data Source wizard cannot be used for binding to a specific object instance, it is required to assign this instance to the DataSource property in code before calling the ObjectDataSource.Fill method.

The following properties are used to bind the ObjectDataSource to data. This member can either be a static, or instance property (method). For example, it is possible to launch the Data Source wizard at runtime and use it to select a required assembly (from among those referenced in the project), and within it, a specific type and method without rebuilding your project and writing any code.Īn ObjectDataSource can be bound to a public class or public member (property or method) of a public class that returns an object implementing the IEnumerable interface. When such an object cannot be accessed from your application code, you can use the ObjectDataSource to obtain the data. Use the ObjectDataSource when your data is provided by an object or there is a method that returns the data as an object, and it is not required to connect to a database to obtain the data. Dashboards (use the DashboardObjectDataSource descendant).ObjectDataSource can be used to supply the following controls/components with data. IDynamicLookupSettingsDataProvider Remarks
