在asp.net webforms中实现搜索功能 [英] Implementing a search function in asp.net webforms
问题描述
它只搜索名称所在的数据库表,并显示输入的那个,没有别的..可以这样做,如果它匹配,我有以特定方式显示数据的列表视图,也可以复制或使用,因此当搜索匹配时,它会显示模块按钮,就像它在我的另一个页面上一样..
如果您需要任何改进或任何事情让我知道,抱歉,如果这听起来很混乱,但任何帮助都会是非常棒的人们。
我是什么尝试过:
我看过youtube视频,但没有什么能与我想要实现的内容相符:(
最简单的方法是使用LIKE关键字
SELECT列FROM MyTable WHERE SomeField LIKE'%hello%'
将搜索SomeField包含Hello的记录。为了做得更好,您还可以查看启用和使用免费在SQL上搜索文本(google上的文章)。下一步是使用像Lucene这样的索引系统为你索引表,你也可以对它执行搜索。 Google如何对sql server使用lucene索引。
Hey folks, I aint sure if this question has been asked before and im sorry if it has but basically, I'm looking to see if anyone here has some code or guidance/idea on how to build a search function where When I type in a "specific" Name or characters, it returns the data but it only returns it if it matches what Ive typed, I aint sure if this can be done and It could mean validation which I aint good with but say for talk sake I had a search box and button and I typed Computer Science, It will only return a module/subject named that, if its spelt wrong or or whatever it wont return.
It will only search the DB table where the names are and display the one that's typed and nothing else.. Can this be done, also if it matches, I have a listview showing data in a specific way, can that be copied or used also so when the search matches it displays the module button like it has on another one of my pages..
If you need any refinement or anything let me know, sorry if it sounds confusing also but any help would be fantastic folks :)
What I have tried:
I have watched youtube videos but nothing matches the specificity of what Im looking to implement :(
The simplest way is to use the "LIKE" keyword
SELECT columns FROM MyTable WHERE SomeField LIKE '%hello%'
that will search records where SomeField contains "Hello". To do it better you can also look into enabling and using free text searching on SQL (google for articles on it). The next step would be to use an indexing system like Lucene to index your tables for you and you can execute searches against that too. Google for how to use lucene indexing against sql server.
这篇关于在asp.net webforms中实现搜索功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!