TAILIEUCHUNG - ASP.NET 4 Unleased - p 92

Các () được gọi là để tạm ứng cho các tập kết quả tiếp theo. Phương thức này trả về hoặc là đúng hay sai tuỳ thuộc vào việc có tồn tại một tập kết quả tiếp theo. Trong Ví dụ 19,22, giả định rằng có cả một thể loại phim và resultset phim. Các trang trong Ví dụ 19,23 hiển thị nội dung của các bảng cơ sở dữ liệu hai trong hai GridView điều khiển (hình 19,10). | 884 CHAPTER 19 Building Data Access Components with newMovie new string reader Title int reader CategoryID newMovie static DataLayer1 _connectionString Movies .ConnectionString The method is called to advance to the next resultset. This method returns either True or False depending on whether a next resultset exists. In Listing it is assumed that there is both a movies category and movies resultset. The page in Listing displays the contents of the two database tables in two GridView controls see Figure . O http locnlhost 1310 - Show Datai ayprl - Morilla Firefox Movie Categories Id Name 1 Adventure 3 Drama 4 Horror Movies Category Id Tide 3 Titanic 1 Star Wars 1 Jurassic Park 1 Jaws 3 host 3 Forrest Gump 2 Ice Age 2 Shrek 1 Independence Day 1 The Ring Done FIGURE Displaying two resultsets. From the Library of Wow eBook Connected Data Access 885 LISTING @ Page Language C @ Import Namespace DOCTYPE html PUBLIC - W3C DTD XHTML Transitional EN http TR xhtml1 DTD script runat server void Page_Load Get database data List categories new List List movies new List categories movies Bind the data categories movies script html xmlns http 1999 xhtml head id Head1 runat server title Show DataLayer1 title head body form id form1 runat server div h1 Movie Categories h1 asp GridView id grdCategories Runat server h1 Movies h1 asp GridView id grdMovies Runat server 19 div form body html From the Library of Wow eBook 886 CHAPTER 19 Building Data Access Components with Working with Multiple Active Resultsets

Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.