组合框相关查询 [英] combo box related query
问题描述
我正在使用Vb.net前端Sharp Development和.net Framework 3.5,数据库msaccess.
我的编码中有一个模块,用于在组合框中显示客户端的所有名称.
我在表单加载时提取名称并显示它.它工作正常.
现在,我想要的是,当用户键入字符b时,将创建一个下拉类型的东西,并且应显示所有以b开头的名称,并首先将重点放在第一条记录上.现在,如果用户按a,则应显示所有以ba开头的名称.
我知道我可以使用%查询来重新填充数据库,但是由于数据库名称很多,所以我不想这样做.
有什么建议吗?
I am using Vb.net front end sharp develop and .net framework 3.5, database msaccess.
There is a module in my coding where I am showing all the names of the client in the combobox.
I''m extracting the names at form load and displaying it. It is working properly.
Now what I want is when the user type character b then a drop down type something should be created and all the name starting with b should be displayed with initial focus on first record. Now when if user press a then all name starting with ba should be displayed.
I know I can repopulate the database using like % query but since the database will have lakhs of name I don''t want to do so.
Any suggestion ?
推荐答案
如果您有一个拥有数百万条记录的大型数据库,则最好使用虚拟下拉列表.当用户开始键入时,请等待大约500毫秒,然后仅对以输入文本开头的名称进行DB提取.您需要异步检索数据以防止UI冻结. 500毫秒的等待时间是为了节省不必要的提取.
If you have a large database with millions of records, it may make better sense to have a virtual drop down. When the user starts typing, wait for about 500 ms and then do a DB fetch for just those names that start with the entered text. You''d need to retrieve the data asynchronously to prevent a UI freeze-up. And the 500ms wait is to save on unwanted fetches.
我建议重新设计.我认为访问似乎不适合大型应用程序.同样,拥有具有这么多值的组合框也没有意义.我建议使用文本框和按钮进行搜索.
I would suggest redesign. I do not think access is suitable for huge applications as your seems to be. Also, it does not makes sense to have a combobox with those many values. I would suggest a search using textbox and a button.
您能解释一下如何添加虚拟组合下拉菜单.
can u explain how to add virtual combo drop.
这篇关于组合框相关查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!