During the page lifecycle, the data Web control may need to access the data it's bound to, which it will accomplish by invoking its Object Data Source's methods.
In this article I will show you how you can use the Object Data Source with the Grid View control to do editing, updating, deleting and adding new records.There are several ways to perform these operations, I am using the simplest approach.If you want to bind the Object Data Source to a class in the .NET Framework such as the Membership class, to access user account information, or the Directory class to work with file system information you'll need to manually set the Object Data Source's properties.Using these controls you can bind data retrieved from the BLL created in the previous tutorial without having to write a line of code! NET 2.0 ships with five built-in data source controls Sql Data Source, Access Data Source, Object Data Source, Xml Data Source, and Site Map Data Source although you can build your own custom data source controls, if needed.
Since we have developed an architecture for our tutorial application, we'll be using the Object Data Source against our BLL classes. NET 2.0 Includes Five Built-In Data Source Controls The Object Data Source serves as a proxy for working with some other object.
The Object Data Source appears as a gray box on the design surface because it does not produce any markup; it simply accesses data by invoking a method from a specified object.
The data returned by an Object Data Source can be displayed by a data Web control, such as the Grid View, Details View, Form View, and so on.
You can, however, configure the Object Data Source through its properties, either through the Properties window or directly in the declarative markup.
Simply set the Even if you prefer the Configure Data Source wizard there may be times when you need to manually configure the Object Data Source, as the wizard only lists developer-created classes.
Figure 4: Specify the Object to Use with the Object Data Source Control (Click to view full-size image) The next screen in the wizard prompts you to select what method the Object Data Source should invoke.