Giới hạn hiển thị dữ liệu trong một Box Bound Danh sách Ngay cả populating một hộp danh sách với một vài cột từ một bảng đầy đủ các dữ liệu có thể là một hiệu suất lớn hit. Điều này thế nào-Để cho bạn thấy làm thế nào để tạo ra một tuyên bố tham số SQL để giới hạn các mục được hiển thị trong danh sách hộp | Limit the Data Displayed in a Bound List Box Even populating a list box with a couple of columns from a table full of data can be a big performance hit. This How-To shows you how to create a parameterized SQL statement to limit the items that are displayed in the list box thus giving you better performance on your forms. You have hundreds of thousands of customers in your database and you don t want the list box loaded up with the whole customer table. How can you limit the data that is displayed in your list box Technique You are going to make a copy of the form that you created in How-To . You will then add a Label and TextBox control that the Select statement contained within the OleDbDataAdapter control will query against to limit the data displayed in the list box. A command button will be added to allow you to call the Fill method of the OleDbDataAdapter control whenever you update the text box and then you can click the command button see Figure . Figure . You can now limit the amount of data loaded into the list box. Steps To get started with this How-To right-click the form you created in How-To which should be listed in the Solutions Explorer. Choose Copy from the pop-up menu. Next right-click the project in the Solution Explorer and choose Paste from the pop-up menu. You will now have a new Class object in the Solutions Explorer called Copy Of whatever the previous name of the form was. Rename the new form that you have created to the name you desire. Then with that form highlighted click on the Code button above the Solutions Explorer. Change the first line of code to say this Public Class Name of the new form You see VS does not change the line of code automatically for you. It thinks you have a duplicate Class definition. Now you can see that the icon of the form is correct. You can continue with the steps of the How-To. 1. Select the Data Adapter that you created. In the Properties pane you will see the CommandText property when you