When the Object Data Source calls your data object, if the result is an exception it will call your post event event-handler (Selected, Deleted, etc).The Event Args has two properties for managing exceptions, one is the Exception itself, the other is a boolean, Exception Handled.
When using Data Sets and Table Adapters, everything is a dream, but when using your own custom objects the wizards and property pages act like you don’t exist.
The good news is with a little extra code, we can have our custom objects act just like fancy Data Sets.
The Object Data Source control enables you to bind Databound controls such as the Grid View, Form View or Details View controls to a custom . In this tutorial I will show you how you can use Object Data Source control to insert data in Database. NET objects as parameters and how you can handle exceptions while inserting data in Database.
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.
A very simple class for a Person could look like this: If you’ve not seen the [ ] syntax before, these are Attributes.
This simple markup tells the compiler additional information about the entity, which is then used to generate additional code.The Grid View control is one of the great time savers of ASP. Sorting, paging, editing, deleting, and even AJAX (set Enable Sorting And Paging Callbacks to True) is included out of the box.The Object Data Source is the other half of the magic, connecting the Grid View to the data and managing any filter controls.The Object Data Source control has Type Name property which specifies the fully qualified name of the custom .NET component you want Object Data Source to connect for its operations.This post was going to be a rant about how using the Object Data Source was impossible to handle exceptions thrown while retrieving or updating data.