Murach's ASP.NET 4 Web Programming
with C# 2010

How to use object data sources

This chapter shows you how to use object data sources to implement 3-layer applications in which the data access code is kept in data access classes. Unlike the Access and SQL data sources that are covered earlier in the book, object data sources let you separate the data access code from the presentation code yet still take advantage of data binding.

Chapter 17 How to use object data sources
An introduction to object data sources 566
How 3-layer applications work in ASP.NET 566
How to use the ObjectDataSource control 568
How to configure an ObjectDataSource control 570
How to work with bound controls 570
A Product List Application 572
The aspx file 574
The ProductDB class 576
How to create a data access class 578
How to design a data access class 578
How to create a select method 580
How to create update, delete, and insert methods 582
How to use attributes to mark a data access class 584
A category Maintenance application 586
The design 586
The aspx file 586
The code-behind file 590
The Category class 592
The CategoryDB class 594
How to use paging with object data sources 598
How to create an ObjectDataSource control that provides for paging 598
How to create a data access class that provides for paging 600




Murach's ASP.NET 4 with C# 2010

Learn more about this book

View the table of contents


More about the eBook



Our 100% Guarantee

First, try our books for 90 days. Then, if you aren't completely convinced that our books are the best ones you've ever used, you can return them for a prompt refund...no questions asked.