tailieunhanh - Murach’s ado net _4 database programming with vb 2010 phần 8
Đã biết làm thế nào để mã trong Visual Basic 2010? Sau đó, tổng thể lập trình web với phiên bản 4. NET của cuốn sách đó là một yêu thích của các nhà phát triển. Nó dạy cho người mới bắt đầu làm thế nào để phát triển các ứng dụng web từ đầu, | Chapter 14 How to use object data sources 493 The Terms Maintenance application Methods of the TermsDB class Method type Signature Select Public Shared Function GetTermsO As IEnumerable Update Public Shared Function updateTerms ByVai Description As string ByVai DueDays As Integer ByVai originalTermsID As Integer ByVai originalDescription As string ByVai original_DueDays As Integer As Integer Delete Public Shared Function DeleteTerms ByVai originalTermsID As Integer ByVai original_Description As string ByVai original_DueDays As Integer As Integer Insert Public Shared Suh InsertTenns ByVai Description As string ByVai DueDays As Integer Description This version of the Terms Maintenance application uses a Gridview control to update and delete rows and a DetailsView control to insert rows. These controls are bound to an object data source control that accesses the Terms table of the Payables database. The data access class named TermsDB provides the select insert update and delete methods. Figure 14-12 The design of the Terms Maintenance application Download from Wow eBook 494 Section 4 How to use with web applications The aspx file The three parts of figure 14-13 show the file for this application. In part 1 you can see the aspx code for the Gridview control that displays the terms rows. Its Columns element includes a BoundField element that s bound to the TermsID column and two TemplateField elements that are bound to the Description and DueDays columns. In part 2 you can see the aspx code for the object data source control. It provides the names of the select insert update and delete methods that will be used to access the data and it names TermsDB as the data access class. Notice that the ConflictDetection attribute is set to CompareAllValues which means that optimistic concurrency will be used. You ll see one way to implement optimistic concurrency with an object data source when you see the Visual Basic code for this .
đang nạp các trang xem trước