We looked at the data source controls in the last chapter and saw how they replaced the data access code, but tightly coupled the GUI to the data methods. To overcome this problem, Microsoft introduced object data source controls, so that we can bind directly to business objects, making it possible to use them in a 3-tier architecture.
Let's see how using object data source controls will shape our application:
2. Add a new form named
3. Add an object data source control, as shown here (drag and drop the object data source control from the Data tab under ToolBox in VS):
5. Then, we need to set the SELECT, UPDATE, and INSERT methods. For our sample, we will just set the SELECT method:
6. Then, we select Finish. We then add a GridView control on the same page and...