TAILIEUCHUNG - Beginning C# 2005 Databases From Novice to Professional phần 9

vì vậy khi bạn gọi phương thức ExecuteReader, bạn sẽ có được một ngoại lệ, như thể hiện trong hình 13-2. Mặc dù nó là một ngoại lệ xử lý dứt điểm, nó vẫn cung cấp cho bạn một chẩn đoán chính xác ExecuteReader: CommandText tài sản có | CHAPTER 15 WORKING WITH EVENTS 391 Table 15-1. Common Events Object Event Delegate Remarks SqlDataAdapter RowUpdating SqlRowUpdatingEventHandler Raised before the row is updated in the database. The event handler receives a SqlRowUpdatingEventArgs object. SqlDataAdapter RowUpdated SqlRowUpdatedEventHandler Raised after a row is updated in the database. The event handler receives a SqlRowUpdatedEventArgs object. SqlDataAdapter FillError FillErrorEventHandler Raised when the Fill method is called. The event handler receives a FillErrorEventArgs object. DataRow Columnchanging DataColumnChangeEventHandler Raised when the data in a data column is changing. The handler receives a DataColumnChangeEventArgs object. DataRow ColumnChanged DataColumnChangeEventHandler Raised after a value has been changed for the specified data column in a data row. The handler receives a DataColumnChangedEventArgs object. DataTable RowChanging DataRowChangeEventHandler Raised when a data row is changing. The event handler receives a DataChangeEventArgs object. DataTable RowChanged DataRowChangeEventHandler Raised after a data row has changed. The event handler receives a DataChangeEventArgs object. DataTable RowDeleting DataRowChangeEventHandler Raised before a data row is deleted. The event handler receives a DataRowChangeEventArgs object. DataTable RowDeleted DataRowChangeEventHandler Raised after a data row is deleted. The event handler receives a DataRowChangeEventArgs object. Try It Out Using RowUpdating and RowUpdated Events Let s experiment with the SQL Server data adapter s RowUpdating and RowUpdated events in this example you ll see how they re raised and handled when a value in a dataset changes 392 CHAPTER 15 WORKING WITH EVENTS 1. Insert the code in Listing 15-5 into the click event handler for the third button. Listing 15-5. button3_Click clear list box create connection SqlConnection conn new SqlConnection @ data source . sqlexpress

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.