TAILIEUCHUNG - Microsoft ADO .NET 4 Step by Step - p 12

Xác định cập nhật và Xóa một quy tắc trong DataRelation: Visual Basic Lưu ý tập thể dục này sử dụng "Chương 5 VB" dự án mẫu và tiếp tục thực hiện trước trong chương này | 86 Microsoft 4 Step by Step 6. Test setting linked child fields to NULL when a parent record is deleted. Set the Delete Rule field to SetNull. Select the first row in the Flights field the one with ID 759. Click the Flights Delete button and confirm the delete action. 7. Review the Flights and Legs fields. Although the first row in the Flights field has been removed its child records in the Legs field remain. However their FlightID column values have been cleared and are set to NULL. Those records no longer have a parent row. Defining the Update and Delete Rules in a DataRelation Visual Basic Note This exercise uses the Chapter 5 VB sample project and continues the previous exercise in this chapter. 1. Open the source code view for the Flightinfo form. Locate the RefreshConstraints method. The application lets the user alter the rules for adjusting the child table when changes are made to the parent table. The RefreshConstraints routine updates the relevant constraint with the user s rule choice. 2. Just after the Alter its cascade rules comment add the following statements CType CType 3. Run the program. The Update Rule and Delete Rule fields are both set to None by default. This prevents parent records Flights from being deleted or having their ID column values changed if related child rows Legs exist. 4. Test cascade updates. Set the Update Rule field to Cascade. Select the first row in the Flights field the one with ID 834. Click the Flights Edit button. Use the Edit Flight form that appears to alter the Flight ID value from 834 to another value such as 759. Click OK on that editor form. 5. Review the Flights and Legs fields. Not only did the first row in the Flights field have its ID value changed to 759 but the FlightID values for the related rows in the Legs field changed to 759 as well. 6. Test setting linked child fields to NULL .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã 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.