Use a Single Windows Form to Update Multiple Lookup Tables Just about every database application

Sử dụng một mẫu đơn để cập nhật Windows Nhiều Lookup Tables Chỉ cần về tất cả các ứng dụng cơ sở dữ liệu sử dụng bảng tra cứu của một số loại hay cách khác, chẳng hạn như loại, vùng và lãnh thổ trong cơ sở dữ liệu Northwind | Use a Single Windows Form to Update Multiple Lookup Tables Just about every database application uses lookup tables of some sort or another such as categories regions and territories in the Northwind database. Normally each of these lookup tables would get its own form for viewing or updating the information in the tables. This example will provide the means for you to create a single form to maintain any of your simple lookup tables again using a Windows Form. You have a number of simple lookup tables in your application and it is a pain to have to create a form for each table. How do you create a Windows Form that can be used to update most if not all of your lookup tables that are contained in your database Technique Using two main controls the ListBox control and DataGrid control you can create a form that will take care of most of your simple lookup tables. When you get into those tables that contain lookups or graphics you will have to come up with a more complete method to modify the data. For this example you will be using some familiar friends DataAdapter CommandBuilder and DataTable objects. Steps Open and run the -Chapter 8 solution. From the main Windows Form click on the command button with the caption How-To . You will then see the form displayed in Figure . Figure . The DataGrid control is filled with different data every time a new item is chosen in the ListBox control. When you choose a new item from the list of tables on the left the data grid on the right becomes filled with the data from the chosen table. You can then modify the data in the data grid and click on the Update button to update the data back to the server. This includes modifying existing records as well as adding and deleting records in the DataGrid control. 1. Create a Windows Form. Then place the controls shown in Figure with the properties set forth in Table . Table . Label ListBox DataGrid and Command Button Controls Property Settings Object .

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
322    93    1    21-06-2024
Đã 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.