i

ASP.Net A Complete Guide

ObjectDataSource

This control allows you to connect our data-bound controls with our Business Layer to create the output. This control also supports declarative parameters. It allows developers to send the variables or control value to business objects as parameters. if ObjectDataSource is configured to call methods from a custom .NET class, then the class must have the default constructor and should have methods that can easily be mapped to select, update, insert or delete operations.

 

Features

The following table Explains the features of the ObjectDataSource control.

Capability

Requirements

Selecting

Set the SelectMethod property that selects data.

Sorting

Set the SortParameterName property that carries the sort criteria.

Filtering

Set the FilterExpression property to  filter the data

Paging

If the SelectMethod contains parameters for the max number of records and the index of the first records and these parameters should set in the MaximumRowsParameterName and StartRowIndexParameterName properties, respectively.

Updating

Set the UpdateMethod property that updates data, and include any necessary parameters in the UpdateParameters collection.

Deleting

Set the DeleteMethod property that deletes data, and includes any necessary parameters in the DeleteParameters collection.

Inserting

Set the InsertMethod property that inserts data, and includes any necessary parameters in the InsertParameters collection.

Caching

Set the EnableCaching property = true, and the CacheDuration and CacheExpirationPolicy properties as per the caching we want for your cached data.