The ObjectDataSource control enables you to bind Databound controls such as the GridView, FormView or DetailsView controls to a custom .NET component. Normally, these custom .NET components are available in Business Login Layer or Data Access Layer and they perform all basic operations such as Insert, Update, Delete or Selecting Data from the backend Data Source. In this tutorial I will show you how you can use ObjectDataSource control to insert data in Database. I will also show you how you can pass custom .NET objects as parameters and how you can handle exceptions while inserting data in Database.
The ObjectDataSource control has TypeName property which specifies the fully qualified name of the custom .NET component you want ObjectDataSource to connect for its operations. It also has four major properties for basic database operations such as SelectMethod, UpdateMethod, InsertMethod and DeleteMethod. These four properties can be set with the names of the methods available in custom .NET component.