Đang chuẩn bị liên kết để tải về tài liệu:
Take Care of Error Handling with Bound Controls

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

Hãy chăm sóc Lỗi Xử lý với Bound Controls Khi giao dịch với nhiệm vụ cơ sở dữ liệu, bạn sẽ nhận được lỗi runtime. Trong. NET, chúng ta gọi các loại lỗi bạn có thể có được ngoại lệ | 1.6 Take Care of Error Handling with Bound Controls When dealing with database tasks you are going to get runtime errors. In .NET we call the various types of errors you can get exceptions. This How-To shows examples of what exceptions could occur and how to handle them using the Try Catch and Finally statements. Adding and deleting records is fine but what happens if an error occurs You tried to delete an existing company and got the screen that appears in Figure 1.10. Figure 1.10. This is an unhandled error called an exception in .NET. How do you make it so errors are handled gracefully within the application using bound controls Technique Error handling is one of the most important aspects of working with data between when a user is entering data and updating the server. If you don t have proper error handling your system will in the best situation give an ugly error message and in the worst blow up and put bad data in your system. In Visual Studio .NET errors are classes called exceptions. Many different inherited types of exceptions exist. Run-time exceptions can occur in just about any part of your application. They can be handled by using Try.Catch.Finally or they can be unhandled where you will see the error in Figure 1.11. Figure 1.11. This error was thrown up from one subroutine to the one that called it. Take a look at a common way to trap exceptions shown in Listing 1.15. Listing 1.15 Standard Code for Handling Exceptions Private Sub MySub Try -Code to be handled here Catch dataException as Exception MessageBox.Show dataException.Message Finally -Code that will occur regardless of if an error occurs. End Try End Sub Following are some basic points to help you when working with exceptions and Try.Catch.Finally blocks The name of the exception object can be whatever you want it to be. dataException was just used as an example. Specific types of exceptions inherit from the base class of System.Exception. OleDbException is one of those classes and you will

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.