Đang chuẩn bị liên kết để tải về tài liệu:
Microsoft ADO .NET 4 Step by Step - p 8

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

Khi thuận tiện như Remove, RemoveAt, và rõ ràng là, họ đến với một số tác dụng phụ tiêu cực. Bởi vì họ hoàn toàn loại bỏ một hàng và bằng chứng tất cả những gì nó từng tồn tại, những phương pháp ngăn ngừa ADO.NET từ thực hiện hành động nhất định, bao gồm cả quản lý hồ sơ loại bỏ trong một cơ sở dữ liệu bên ngoài. | 46 Microsoft ADO.NET 4 Step by Step To remove all rows from a table at once use the DataTable.Rows object s Clear method. C someTable.Rows.ClearO Visual Basic someTable.Rows.ClearO As convenient as Remove RemoveAt and Clear are they come with some negative side effects. Because they fully remove a row and all evidence that it ever existed these methods prevent ADO.NET from performing certain actions including managing record removes within an external database. The next section Batch Processing discusses a better method of removing data records from a DataTable instance. Batch Processing The features shown previously for adding modifying and removing data records within a DataTable all take immediate action on the content of the table. When you use the Add method to add a new row it s included immediately. Any field-level changes made within rows are stored and considered part of the record assuming that no data-specific exceptions get thrown during the updates. After you remove a row from a table the table acts as if it never existed. Although this type of instant data gratification is nice when using a DataTable as a simple data store sometimes it is preferable to postpone data changes or make several changes at once especially when you need to verify that changes occurring across multiple rows are collectively valid. ADO.NET includes table and row-level features that let you set up proposed changes to be accepted or rejected en masse. When you connect data tables to their external database counterparts in later chapters ADO.NET uses these features to ensure that updates to both the local copy of the data and the remote database copy retain their integrity. You can also use them for your own purposes however to monitor changes to independent DataTable instances. Note In reality ADO.NET always uses these batch processing monitoring tools when changes are made to any rows in a table even changes such as those in this chapter s simple code samples. Fortunately the .

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.