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

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 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 4 Step by Step To remove all rows from a table at once use the object s Clear method. C Visual Basic 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 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. 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 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 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 .

Đã 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.