Chapter 4. Data Binding to Business Objects


4. Data Binding to Business Objects

In the previous chapter, you saw how the SqlDataSource control provides a declarative way to access databases, allowing easy two-way data binding for controls. While this works well, and is acceptable in certain sites, many people wish to move all data access out of the ASP.NET pages. This is a fairly standard arrangement, as it leaves the ASP.NET pages containing just the user interfacethose bits that the user sees. All data access code is moved into a set of classes, which makes development and maintenance easier, especially in large organizations with teams of developers.

In this chapter we're going to look at what features ASP.NET 2.0 provides to enable this scenariothe use of data and business layers to abstract logic away from the page. In particular, we are going to cover the following topics:

  • How to create business and data layers

  • How to use the ObjectDataSource control to provide declarative access to the business and data layers

  • How to use Typed Data Sets as business objects

As we progress through this chapter, you'll see that many aspects of using the ObjectDataSource control are similar to the SqlDataSource control seen in the previous chapter.



ASP. NET 2.0 Illustrated
ASP.NET 2.0 Illustrated
ISBN: 0321418344
EAN: 2147483647
Year: 2006
Pages: 147

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net