ASP.NET 2.0 All-In-One Desk Reference For Dummies®
by Doug Lowe, Jeff Cogswell, Ken Cox - Microsoft MVP
Chapter 5. Advanced Data Retrieval
In This Chapter
✓ | Steering clear of the Eval method |
✓ | Attaching to different kinds of data |
✓ | Advanced Repeater usage |
In this chapter, I explore several advanced topics of data retrieval in your ASP.NET programs. Although I tag this section “advanced,” everything is relative. If you’ve mastered the rest of the data-access topics in this mini-book, I strongly encourage you to master these topics as well; they offer some deeper insight into getting the most power out of your data-ready Web sites.
In this chapter, I look at how to bind to different types of data — including your own ArrayList containers — as well as how to skip the somewhat cumbersome SqlDataSource control. I also talk about how to get more out of your Repeater controls (a control I personally find incredibly powerful through its simplicity). I begin the chapter with a discussion of the elusive concept of binding — and a convoluted, but worthwhile, alternative to the Eval method that was presented in Chapter 2 of this mini-book.

All the code listings that are used in this book are available for download at www.dummies.com/go/aspnetaiofd.
Ditching the Eval Method
When you bind to data using the <%# %> tags in a typical .aspx file, you’re making use of a special ASP.NET syntax. Inside these constructs, what you can do is pretty limited. This is a source of a lot of confusion among ASP.NET programmers. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access