An ObjectDataSource control can be used to represent any type of Object in .Net framework.We can use ObjectDataSource control with components that represent Collections,ADO.Net Objects(DataReader,DataSet etc),LINQ to SQL queries and Web Services.
ObjectDataSource Control has five mostly used properties:
1.TypeName :the name of the type of object the control representing
2.SelectMethod :the method name the ObjectDataSource calls for selecting data
3.UpdateMethod :the method name the ObjectDataSource calls for updating data
4.InsertMethod :the method name the ObjectDataSource calls for inserting data
5.DeleteMethod :the method name the ObjectDataSource calls for deleting data
Binding ObjectDataSourceControl to a collection:
For binding the ObjectDataSourceControl with a collection we have to use the TypeName and SelectMethod properties of the control .Lets start with a class called Employees which has a method called LoadEmployeesData() which returns a collection of Employees’ names.Our class will be like the following one.