Google喜欢将数据存储在数据库中的搜索 [英] Google like search where the data must be on database

查看:94
本文介绍了Google喜欢将数据存储在数据库中的搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,程序员在这里遇到了一些问题.我想要的是,当我键入...时,例如说一个文本框或一个下拉列表,字母"A",数据库中所有以开头字母"A"开头的数据都将像建议一样在下面发布..基本上,我想创建类似google搜索框的内容,但这将基于我的数据库.如果用户键入新内容,它将被添加到我的数据库中.先生/女士,有关此事的任何教程吗?


在此先谢谢您..

Hello programmers, got a few problems here. All I want is that when I type on ... let say example a textbox or a dropdown,letter "A", All data from the database with starting letter "A" will be post below like a suggestion.. Basically I want to create something like google search box but it will be based on my database. If the user type something new, it will be added to my database. Any tutorial regarding this matter Sir/Madams?


Thanks in advance..

推荐答案

您想要的东西称为自动完成文本框,如果您要搜索的话,有很多示例
What you want is called an auto complete text box and there are many examples if you search for it


1.将文本框绑定到集合.
2.初始化时,使用数据库中的数据加载集合.
3.在按键事件中,使用键入的字母过滤集合.您可以使用Link with collection,并使用Find<>谓词委托的方法.

了解C#中的谓词代表 [
1. Bind the text box to a collection.
2. Load the collection with data from database on initialize.
3. On key press event, filter the collection with letter typed. You can use Link with collection, and use Find<> method which takes a predicate delegate.

Understanding Predicate Delegates in C#[^]


这篇关于Google喜欢将数据存储在数据库中的搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆